Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | pmbaty | 1 | #ifndef HARNESS_GL_RENDERER |
2 | #define HARNESS_GL_RENDERER |
||
3 | |||
4 | #include "harness.h" |
||
5 | #include "harness/hooks.h" |
||
6 | |||
7 | #define CHECK_GL_ERROR(msg) \ |
||
8 | { \ |
||
9 | GLenum e = glGetError(); \ |
||
10 | if (e != GL_NO_ERROR) { \ |
||
11 | const char* err; \ |
||
12 | switch (e) { \ |
||
13 | case GL_NO_ERROR: \ |
||
14 | err = "GL_NO_ERROR"; \ |
||
15 | break; \ |
||
16 | case GL_INVALID_ENUM: \ |
||
17 | err = "GL_INVALID_ENUM"; \ |
||
18 | break; \ |
||
19 | case GL_INVALID_VALUE: \ |
||
20 | err = "GL_INVALID_VALUE"; \ |
||
21 | break; \ |
||
22 | case GL_INVALID_OPERATION: \ |
||
23 | err = "GL_INVALID_OPERATION"; \ |
||
24 | break; \ |
||
25 | case GL_INVALID_FRAMEBUFFER_OPERATION: \ |
||
26 | err = "GL_INVALID_FRAMEBUFFER_OPERATION"; \ |
||
27 | break; \ |
||
28 | case GL_OUT_OF_MEMORY: \ |
||
29 | err = "GL_OUT_OF_MEMORY"; \ |
||
30 | break; \ |
||
31 | case GL_STACK_UNDERFLOW: \ |
||
32 | err = "GL_STACK_UNDERFLOW"; \ |
||
33 | break; \ |
||
34 | case GL_STACK_OVERFLOW: \ |
||
35 | err = "GL_STACK_OVERFLOW"; \ |
||
36 | break; \ |
||
37 | default: \ |
||
38 | err = "unknown"; \ |
||
39 | break; \ |
||
40 | } \ |
||
41 | LOG_PANIC("glError %d (%s): %s", e, err, msg); \ |
||
42 | } \ |
||
43 | } |
||
44 | |||
45 | void GLRenderer_Init(int render_width, int render_height); |
||
46 | void GLRenderer_SetPalette(uint8_t* rgba_colors); |
||
47 | void GLRenderer_BeginScene(br_actor* camera, br_pixelmap* colour_buffer, br_pixelmap* depth_buffer); |
||
48 | void GLRenderer_EndScene(void); |
||
49 | void GLRenderer_FullScreenQuad(uint8_t* screen_buffer); |
||
50 | void GLRenderer_Model(br_actor* actor, br_model* model, br_material* material, br_token render_type, br_matrix34 model_matrix); |
||
51 | void GLRenderer_BufferTexture(br_pixelmap* pm); |
||
52 | void GLRenderer_BufferMaterial(br_material* mat); |
||
53 | void GLRenderer_BufferModel(br_model* model); |
||
54 | void GLRenderer_ClearBuffers(void); |
||
55 | void GLRenderer_FlushBuffer(tRenderer_flush_type flush_type); |
||
56 | void GLRenderer_FlushBuffers(void); |
||
57 | void GLRenderer_SetViewport(int x, int y, int width, int height); |
||
58 | |||
59 | #endif |