Subversion Repositories Kolibri OS

Rev

Rev 6115 | Go to most recent revision | Details | 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"
9
#include "GL/gl.h"
10
 
11
struct bitmap
12
{
13
    uint32_t    width;
14
    uint32_t    height;
15
    uint32_t    pitch;
16
    void       *buffer;
17
    GLuint      tex;
18
    GLuint      handle;
19
    GLuint      name;
20
    EGLImageKHR image;
21
};
22
 
23
enum
24
{
25
    TEX_SCREEN = 0,
26
    TEX_MASK   = 1
27
};
28
 
29
struct render
30
{
31
    int fd;
32
    EGLDisplay dpy;
33
    EGLContext context;
34
    EGLint dx;
35
    EGLint dy;
36
    EGLint width;
37
    EGLint height;
38
    EGLint scr_width;
39
    EGLint scr_height;
40
    GLuint texture[2];
41
    GLuint framebuffer;
42
    EGLImageKHR screen;
43
    struct bitmap mask;
44
 
45
    int    mask_size;
46
 
47
    GLuint blit_prog;
48
    GLint sampler, sm_mask;
49
    float vertices[8],tc_src[8];
50
};
51
 
52
int egl_initialize(EGLDisplay *dpy, EGLConfig *config, EGLContext *context);
53
void egl_destroy(EGLDisplay dpy, EGLContext context);
54
 
55
#define ENTER()   printf("enter %s\n",__FUNCTION__)
56
#define LEAVE()   printf("leave %s\n",__FUNCTION__)
57
#define FAIL()    printf("fail %s\n",__FUNCTION__)
58
 
59
#ifdef DEBUG
60
#define DBG(...) do {                   \
61
    fprintf(stderr, __VA_ARGS__);       \
62
} while (0)
63
#else
64
#define DBG(...)
65
#endif
66
 
67
#endif  /* __GL_RENDER_H__ */