comparison nuklear_ui/nuklear_sdl_gles2.h @ 1538:b581663c42ec nuklear_ui

Don't try to use GLES specific stuff unless we're actualy on a GLES platform
author Michael Pavone <pavone@retrodev.com>
date Sun, 25 Mar 2018 10:47:48 -0700
parents b82a44729d7c
children fa9ae059e4d3
comparison
equal deleted inserted replaced
1537:b4914d92308b 1538:b581663c42ec
71 struct nk_sdl_device ogl; 71 struct nk_sdl_device ogl;
72 struct nk_context ctx; 72 struct nk_context ctx;
73 struct nk_font_atlas atlas; 73 struct nk_font_atlas atlas;
74 } sdl; 74 } sdl;
75 75
76 76 #ifdef USE_GLES
77 #define NK_SHADER_VERSION "#version 100\n" 77 #define NK_SHADER_VERSION "#version 100\n"
78 #define DECLARE_PRECISION "precision mediump float;\n"
79 #else
80 #define NK_SHADER_VERSION "#version 110\n"
81 #define DECLARE_PRECISION
82 #endif
78 83
79 84
80 NK_API void 85 NK_API void
81 nk_sdl_device_create(void) 86 nk_sdl_device_create(void)
82 { 87 {
94 " Frag_Color = Color;\n" 99 " Frag_Color = Color;\n"
95 " gl_Position = ProjMtx * vec4(Position.xy, 0, 1);\n" 100 " gl_Position = ProjMtx * vec4(Position.xy, 0, 1);\n"
96 "}\n"; 101 "}\n";
97 static const GLchar *fragment_shader = 102 static const GLchar *fragment_shader =
98 NK_SHADER_VERSION 103 NK_SHADER_VERSION
99 "precision mediump float;\n" 104 DECLARE_PRECISION
100 "uniform sampler2D Texture;\n" 105 "uniform sampler2D Texture;\n"
101 "varying vec2 Frag_UV;\n" 106 "varying vec2 Frag_UV;\n"
102 "varying vec4 Frag_Color;\n" 107 "varying vec4 Frag_Color;\n"
103 "void main(){\n" 108 "void main(){\n"
104 " gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV);\n" 109 " gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV);\n"