Switch to GLES2

Closes #13
This commit is contained in:
Drew DeVault 2017-06-23 11:38:45 -04:00
parent 168f0955ab
commit b18209c904
14 changed files with 97 additions and 111 deletions

View file

@ -3,7 +3,7 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <GLES3/gl3.h>
#include <GLES2/gl2.h>
#include <wlr/render.h>
struct wlr_surface_state {
@ -11,7 +11,7 @@ struct wlr_surface_state {
GLuint tex_id;
};
struct wlr_surface *gles3_surface_init();
struct wlr_surface *gles2_surface_init();
extern const GLchar quad_vertex_src[];
extern const GLchar quad_fragment_src[];
@ -20,10 +20,10 @@ extern const GLchar vertex_src[];
extern const GLchar fragment_src_RGB[];
extern const GLchar fragment_src_RGBA[];
bool _gles3_flush_errors(const char *file, int line);
#define gles3_flush_errors(...) \
_gles3_flush_errors(__FILE__ + strlen(WLR_SRC_DIR) + 1, __LINE__)
bool _gles2_flush_errors(const char *file, int line);
#define gles2_flush_errors(...) \
_gles2_flush_errors(__FILE__ + strlen(WLR_SRC_DIR) + 1, __LINE__)
#define GL_CALL(func) func; gles3_flush_errors()
#define GL_CALL(func) func; gles2_flush_errors()
#endif

View file

@ -0,0 +1,7 @@
#ifndef _WLR_GLES2_RENDERER_H
#define _WLR_GLES2_RENDERER_H
#include <wlr/render.h>
struct wlr_renderer *wlr_gles2_renderer_init();
#endif

View file

@ -1,7 +0,0 @@
#ifndef _WLR_GLES3_RENDERER_H
#define _WLR_GLES3_RENDERER_H
#include <wlr/render.h>
struct wlr_renderer *wlr_gles3_renderer_init();
#endif