summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-02-21 12:39:54 -0500
committerRob Clark <robdclark@gmail.com>2017-02-21 14:34:26 -0500
commitf42ba05ef0fb3a5aea77b3cdd788d21ed92f677e (patch)
tree1b90838a2b709a5bdedcdc7be8148a9c4320e581 /common.h
parent2ec69c153a5456758c924e14e70d6544e4d2a866 (diff)
downloadkmscube-f42ba05ef0fb3a5aea77b3cdd788d21ed92f677e.tar.gz
split out smooth-shaded cube
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 */