mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-16 11:52:34 +03:00
68 lines
1.3 KiB
C
68 lines
1.3 KiB
C
|
#ifndef __GL_RENDER_H__
|
||
|
#define __GL_RENDER_H__
|
||
|
|
||
|
#define EGL_EGLEXT_PROTOTYPES
|
||
|
#define GL_GLEXT_PROTOTYPES
|
||
|
|
||
|
#include "EGL/egl.h"
|
||
|
#include "EGL/eglext.h"
|
||
|
#include "GL/gl.h"
|
||
|
|
||
|
struct bitmap
|
||
|
{
|
||
|
uint32_t width;
|
||
|
uint32_t height;
|
||
|
uint32_t pitch;
|
||
|
void *buffer;
|
||
|
GLuint tex;
|
||
|
GLuint handle;
|
||
|
GLuint name;
|
||
|
EGLImageKHR image;
|
||
|
};
|
||
|
|
||
|
enum
|
||
|
{
|
||
|
TEX_SCREEN = 0,
|
||
|
TEX_MASK = 1
|
||
|
};
|
||
|
|
||
|
struct render
|
||
|
{
|
||
|
int fd;
|
||
|
EGLDisplay dpy;
|
||
|
EGLContext context;
|
||
|
EGLint dx;
|
||
|
EGLint dy;
|
||
|
EGLint width;
|
||
|
EGLint height;
|
||
|
EGLint scr_width;
|
||
|
EGLint scr_height;
|
||
|
GLuint texture[2];
|
||
|
GLuint framebuffer;
|
||
|
EGLImageKHR screen;
|
||
|
struct bitmap mask;
|
||
|
|
||
|
int mask_size;
|
||
|
|
||
|
GLuint blit_prog;
|
||
|
GLint sampler, sm_mask;
|
||
|
float vertices[8],tc_src[8];
|
||
|
};
|
||
|
|
||
|
int egl_initialize(EGLDisplay *dpy, EGLConfig *config, EGLContext *context);
|
||
|
void egl_destroy(EGLDisplay dpy, EGLContext context);
|
||
|
|
||
|
#define ENTER() printf("enter %s\n",__FUNCTION__)
|
||
|
#define LEAVE() printf("leave %s\n",__FUNCTION__)
|
||
|
#define FAIL() printf("fail %s\n",__FUNCTION__)
|
||
|
|
||
|
#ifdef DEBUG
|
||
|
#define DBG(...) do { \
|
||
|
fprintf(stderr, __VA_ARGS__); \
|
||
|
} while (0)
|
||
|
#else
|
||
|
#define DBG(...)
|
||
|
#endif
|
||
|
|
||
|
#endif /* __GL_RENDER_H__ */
|