|
@@ -8,11 +8,13 @@ |
|
|
|
|
|
|
|
|
#include "../ext/osdialog/osdialog.h" |
|
|
#include "../ext/osdialog/osdialog.h" |
|
|
|
|
|
|
|
|
#define NANOVG_GL2_IMPLEMENTATION |
|
|
|
|
|
// #define NANOVG_GL3_IMPLEMENTATION |
|
|
|
|
|
|
|
|
#define NANOVG_GL2 1 |
|
|
|
|
|
// #define NANOVG_GL3 1 |
|
|
|
|
|
// #define NANOVG_GLES2 1 |
|
|
|
|
|
#define NANOVG_GL_IMPLEMENTATION 1 |
|
|
#include "../ext/nanovg/src/nanovg_gl.h" |
|
|
#include "../ext/nanovg/src/nanovg_gl.h" |
|
|
// Hack to get framebuffer objects working on OpenGL 2 (we blindly assume the extension is supported) |
|
|
// Hack to get framebuffer objects working on OpenGL 2 (we blindly assume the extension is supported) |
|
|
#define NANOVG_FBO_VALID 1 |
|
|
|
|
|
|
|
|
// #define NANOVG_FBO_VALID 1 |
|
|
#include "../ext/nanovg/src/nanovg_gl_utils.h" |
|
|
#include "../ext/nanovg/src/nanovg_gl_utils.h" |
|
|
#define BLENDISH_IMPLEMENTATION |
|
|
#define BLENDISH_IMPLEMENTATION |
|
|
#include "../ext/oui-blendish/blendish.h" |
|
|
#include "../ext/oui-blendish/blendish.h" |
|
@@ -353,11 +355,22 @@ void guiInit() { |
|
|
glfwSetWindowSizeLimits(gWindow, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE); |
|
|
glfwSetWindowSizeLimits(gWindow, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE); |
|
|
|
|
|
|
|
|
// Set up NanoVG |
|
|
// Set up NanoVG |
|
|
|
|
|
#if defined NANOVG_GL2 |
|
|
gVg = nvgCreateGL2(NVG_ANTIALIAS); |
|
|
gVg = nvgCreateGL2(NVG_ANTIALIAS); |
|
|
// gVg = nvgCreateGL3(NVG_ANTIALIAS); |
|
|
|
|
|
|
|
|
#elif defined NANOVG_GL3 |
|
|
|
|
|
gVg = nvgCreateGL3(NVG_ANTIALIAS); |
|
|
|
|
|
#elif defined NANOVG_GLES2 |
|
|
|
|
|
gVg = nvgCreateGLES2(NVG_ANTIALIAS); |
|
|
|
|
|
#endif |
|
|
assert(gVg); |
|
|
assert(gVg); |
|
|
|
|
|
|
|
|
|
|
|
#if defined NANOVG_GL2 |
|
|
gFramebufferVg = nvgCreateGL2(NVG_ANTIALIAS); |
|
|
gFramebufferVg = nvgCreateGL2(NVG_ANTIALIAS); |
|
|
|
|
|
#elif defined NANOVG_GL3 |
|
|
|
|
|
gFramebufferVg = nvgCreateGL3(NVG_ANTIALIAS); |
|
|
|
|
|
#elif defined NANOVG_GLES2 |
|
|
|
|
|
gFramebufferVg = nvgCreateGLES2(NVG_ANTIALIAS); |
|
|
|
|
|
#endif |
|
|
assert(gFramebufferVg); |
|
|
assert(gFramebufferVg); |
|
|
|
|
|
|
|
|
// Set up Blendish |
|
|
// Set up Blendish |
|
@@ -375,9 +388,23 @@ void guiInit() { |
|
|
|
|
|
|
|
|
void guiDestroy() { |
|
|
void guiDestroy() { |
|
|
gGuiFont.reset(); |
|
|
gGuiFont.reset(); |
|
|
|
|
|
|
|
|
|
|
|
#if defined NANOVG_GL2 |
|
|
nvgDeleteGL2(gVg); |
|
|
nvgDeleteGL2(gVg); |
|
|
// nvgDeleteGL3(gVg); |
|
|
|
|
|
|
|
|
#elif defined NANOVG_GL3 |
|
|
|
|
|
nvgDeleteGL3(gVg); |
|
|
|
|
|
#elif defined NANOVG_GLES2 |
|
|
|
|
|
nvgDeleteGLES2(gVg); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if defined NANOVG_GL2 |
|
|
nvgDeleteGL2(gFramebufferVg); |
|
|
nvgDeleteGL2(gFramebufferVg); |
|
|
|
|
|
#elif defined NANOVG_GL3 |
|
|
|
|
|
nvgDeleteGL3(gFramebufferVg); |
|
|
|
|
|
#elif defined NANOVG_GLES2 |
|
|
|
|
|
nvgDeleteGLES2(gFramebufferVg); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
glfwDestroyWindow(gWindow); |
|
|
glfwDestroyWindow(gWindow); |
|
|
glfwTerminate(); |
|
|
glfwTerminate(); |
|
|
} |
|
|
} |
|
|