From d38cce4406eca4d0505f3d5103e4a003aca44045 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 25 Mar 2018 10:47:48 -0700 Subject: Don't try to use GLES specific stuff unless we're actualy on a GLES platform --HG-- branch : nuklear_ui --- nuklear_ui/nuklear_sdl_gles2.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nuklear_ui/nuklear_sdl_gles2.h') diff --git a/nuklear_ui/nuklear_sdl_gles2.h b/nuklear_ui/nuklear_sdl_gles2.h index e22ec1d..c727f31 100644 --- a/nuklear_ui/nuklear_sdl_gles2.h +++ b/nuklear_ui/nuklear_sdl_gles2.h @@ -73,8 +73,13 @@ static struct nk_sdl { struct nk_font_atlas atlas; } sdl; - +#ifdef USE_GLES #define NK_SHADER_VERSION "#version 100\n" +#define DECLARE_PRECISION "precision mediump float;\n" +#else +#define NK_SHADER_VERSION "#version 110\n" +#define DECLARE_PRECISION +#endif NK_API void @@ -96,7 +101,7 @@ nk_sdl_device_create(void) "}\n"; static const GLchar *fragment_shader = NK_SHADER_VERSION - "precision mediump float;\n" + DECLARE_PRECISION "uniform sampler2D Texture;\n" "varying vec2 Frag_UV;\n" "varying vec4 Frag_Color;\n" -- cgit v1.2.3