|
@@ -27,12 +27,17 @@ static struct nk_sdl {
|
|
struct nk_font_atlas atlas;
|
|
struct nk_font_atlas atlas;
|
|
} sdl;
|
|
} sdl;
|
|
|
|
|
|
|
|
+#ifdef __APPLE__
|
|
|
|
+ #define NK_SHADER_VERSION "#version 150\n"
|
|
|
|
+#else
|
|
|
|
+ #define NK_SHADER_VERSION "#version 300 es\n"
|
|
|
|
+#endif
|
|
NK_API void
|
|
NK_API void
|
|
nk_sdl_device_create(void)
|
|
nk_sdl_device_create(void)
|
|
{
|
|
{
|
|
GLint status;
|
|
GLint status;
|
|
static const GLchar *vertex_shader =
|
|
static const GLchar *vertex_shader =
|
|
- "#version 300 es\n"
|
|
|
|
|
|
+ NK_SHADER_VERSION
|
|
"uniform mat4 ProjMtx;\n"
|
|
"uniform mat4 ProjMtx;\n"
|
|
"in vec2 Position;\n"
|
|
"in vec2 Position;\n"
|
|
"in vec2 TexCoord;\n"
|
|
"in vec2 TexCoord;\n"
|
|
@@ -45,7 +50,7 @@ nk_sdl_device_create(void)
|
|
" gl_Position = ProjMtx * vec4(Position.xy, 0, 1);\n"
|
|
" gl_Position = ProjMtx * vec4(Position.xy, 0, 1);\n"
|
|
"}\n";
|
|
"}\n";
|
|
static const GLchar *fragment_shader =
|
|
static const GLchar *fragment_shader =
|
|
- "#version 300 es\n"
|
|
|
|
|
|
+ NK_SHADER_VERSION
|
|
"precision mediump float;\n"
|
|
"precision mediump float;\n"
|
|
"uniform sampler2D Texture;\n"
|
|
"uniform sampler2D Texture;\n"
|
|
"in vec2 Frag_UV;\n"
|
|
"in vec2 Frag_UV;\n"
|