summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/common.h b/common.h
index fbbed23..0e537ac 100644
--- a/common.h
+++ b/common.h
@@ -24,6 +24,12 @@
#ifndef _COMMON_H
#define _COMMON_H
+#define GL_GLEXT_PROTOTYPES 1
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
#include <gbm.h>
#define GL_GLEXT_PROTOTYPES 1
@@ -35,12 +41,28 @@
struct gbm {
struct gbm_device *dev;
struct gbm_surface *surface;
+ int width, height;
};
const struct gbm * init_gbm(int drm_fd, int w, int h);
+struct egl {
+ EGLDisplay display;
+ EGLConfig config;
+ EGLContext context;
+ EGLSurface surface;
+
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
+
+ void (*draw)(unsigned i);
+};
+
+int init_egl(struct egl *egl, const struct gbm *gbm);
int create_program(const char *vs_src, const char *fs_src);
int link_program(unsigned program);
+
+const struct egl * init_cube_smooth(const struct gbm *gbm);
+
#endif /* _COMMON_H */