Fix: OpenGL changes of Nuklear
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user