Rev 5371 | Rev 6137 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5371 | serge | 1 | #ifndef __GL_RENDER_H__ |
2 | #define __GL_RENDER_H__ |
||
3 | |||
4 | #define EGL_EGLEXT_PROTOTYPES |
||
5 | #define GL_GLEXT_PROTOTYPES |
||
6 | |||
7 | #include "EGL/egl.h" |
||
8 | #include "EGL/eglext.h" |
||
6115 | serge | 9 | #include "EGL/eglmesaext.h" |
5371 | serge | 10 | #include "GL/gl.h" |
11 | |||
12 | struct bitmap |
||
13 | { |
||
14 | uint32_t width; |
||
15 | uint32_t height; |
||
16 | uint32_t pitch; |
||
17 | void *buffer; |
||
18 | GLuint tex; |
||
19 | GLuint handle; |
||
20 | GLuint name; |
||
21 | EGLImageKHR image; |
||
22 | }; |
||
23 | |||
6115 | serge | 24 | struct planar |
25 | { |
||
26 | uint32_t width; |
||
27 | uint32_t height; |
||
28 | GLuint name; |
||
29 | EGLImageKHR planar_image; |
||
30 | EGLImageKHR image[3]; |
||
31 | GLuint offset[3]; |
||
32 | GLuint pitch[3]; |
||
33 | GLuint tex[3]; |
||
34 | }; |
||
35 | |||
5371 | serge | 36 | enum |
37 | { |
||
38 | TEX_SCREEN = 0, |
||
39 | TEX_MASK = 1 |
||
40 | }; |
||
41 | |||
42 | struct render |
||
43 | { |
||
44 | int fd; |
||
45 | EGLDisplay dpy; |
||
46 | EGLContext context; |
||
47 | EGLint dx; |
||
48 | EGLint dy; |
||
49 | EGLint width; |
||
50 | EGLint height; |
||
51 | EGLint scr_width; |
||
52 | EGLint scr_height; |
||
53 | GLuint texture[2]; |
||
54 | GLuint framebuffer; |
||
55 | EGLImageKHR screen; |
||
56 | struct bitmap mask; |
||
57 | |||
58 | int mask_size; |
||
59 | |||
60 | GLuint blit_prog; |
||
61 | GLint sampler, sm_mask; |
||
62 | float vertices[8],tc_src[8]; |
||
63 | }; |
||
64 | |||
65 | int egl_initialize(EGLDisplay *dpy, EGLConfig *config, EGLContext *context); |
||
66 | void egl_destroy(EGLDisplay dpy, EGLContext context); |
||
67 | |||
68 | #define ENTER() printf("enter %s\n",__FUNCTION__) |
||
69 | #define LEAVE() printf("leave %s\n",__FUNCTION__) |
||
70 | #define FAIL() printf("fail %s\n",__FUNCTION__) |
||
71 | |||
72 | #ifdef DEBUG |
||
73 | #define DBG(...) do { \ |
||
74 | fprintf(stderr, __VA_ARGS__); \ |
||
75 | } while (0) |
||
76 | #else |
||
77 | #define DBG(...) |
||
78 | #endif |
||
79 | |||
80 | #endif /* __GL_RENDER_H__ */ |