diff --git a/src/context.c b/src/context.c index eadafdb..2ac5b76 100644 --- a/src/context.c +++ b/src/context.c @@ -4,10 +4,14 @@ void set_clean_color_context(unsigned char r, unsigned char g, unsigned char b) { glEnable(GL_DEPTH_TEST); - glClearColor((float)r / 0xff, (float)g / 0xff, (float)b / 0xff, 1.0); } int init_context(void) { return glewInit(); } -void clean_context(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } +void clean_context(void) +{ + /* This is important cos, Nuklear Disable DEPTH TEST */ + glEnable(GL_DEPTH_TEST); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); +} diff --git a/src/main.c b/src/main.c index 3f223af..4a415b3 100644 --- a/src/main.c +++ b/src/main.c @@ -140,7 +140,7 @@ int main(void) mlog("[GUI] Inicializando...\n"); { struct nk_font_atlas* atlas; - context = nk_glfw3_init(&glfw, window, NK_GLFW3_INSTALL_CALLBACKS); + context = nk_glfw3_init(&glfw, window, NK_GLFW3_DEFAULT ); nk_glfw3_font_stash_begin(&glfw, &atlas); nk_glfw3_font_stash_end(&glfw); } diff --git a/src/window.c b/src/window.c index 2354aa6..23e06d9 100644 --- a/src/window.c +++ b/src/window.c @@ -72,8 +72,13 @@ window_t init_window(unsigned int width, unsigned int height, const char *title) void use_window(window_t window) { glfwMakeContextCurrent((void *)window); } +extern int window_width, window_height; + int is_open_window(window_t window) { + /* Restore window proportions if Nuklear breaks it */ + __window_callback_input((GLFWwindow *)window, window_width, window_height); + glfwSwapBuffers((void *)window); glfwPollEvents();