|
@@ -11,8 +11,6 @@
|
|
#include <limits.h>
|
|
#include <limits.h>
|
|
|
|
|
|
#include <GL/glew.h>
|
|
#include <GL/glew.h>
|
|
-#include <GL/gl.h>
|
|
|
|
-#include <GL/glu.h>
|
|
|
|
#include <GLFW/glfw3.h>
|
|
#include <GLFW/glfw3.h>
|
|
|
|
|
|
#define NK_INCLUDE_FIXED_TYPES
|
|
#define NK_INCLUDE_FIXED_TYPES
|
|
@@ -32,6 +30,12 @@
|
|
#define MAX_ELEMENT_MEMORY 128 * 1024
|
|
#define MAX_ELEMENT_MEMORY 128 * 1024
|
|
#define UNUSED(a) (void)a
|
|
#define UNUSED(a) (void)a
|
|
|
|
|
|
|
|
+#ifdef __APPLE__
|
|
|
|
+ #define NK_SHADER_VERSION "#version 150\n"
|
|
|
|
+#else
|
|
|
|
+ #define NK_SHADER_VERSION "#version 300 es\n"
|
|
|
|
+#endif
|
|
|
|
+
|
|
/* ===============================================================
|
|
/* ===============================================================
|
|
*
|
|
*
|
|
* DEVICE
|
|
* DEVICE
|
|
@@ -52,12 +56,13 @@ struct device {
|
|
GLuint font_tex;
|
|
GLuint font_tex;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+
|
|
static void
|
|
static void
|
|
device_init(struct device *dev)
|
|
device_init(struct device *dev)
|
|
{
|
|
{
|
|
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"
|
|
@@ -70,7 +75,7 @@ device_init(struct device *dev)
|
|
" 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"
|