From 5a749e821468ee39042562dda2b79d75b4c7f2c7 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 5 May 2021 22:51:17 +0200 Subject: [PATCH] Properly create OpenGL context on Linux --- src/gl/MiniFB_GL.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/MiniFB_GL.c b/src/gl/MiniFB_GL.c index 287b266..4513b2b 100644 --- a/src/gl/MiniFB_GL.c +++ b/src/gl/MiniFB_GL.c @@ -95,6 +95,7 @@ setup_pixel_format(SWindowData_X11 *window_data_x11) { XCloseDisplay(window_data_x11->display); return false; } + window_data_x11->context = glXCreateContext(window_data_x11->display, visualInfo, NULL, GL_TRUE); return true; } @@ -140,7 +141,6 @@ create_GL_context(SWindowData *window_data) { if (setup_pixel_format(window_data_x11) == false) return false; - window_data_x11->context = glXCreateContext(window_data_x11->display, visualInfo, NULL, GL_TRUE); glXMakeCurrent(window_data_x11->display, window_data_x11->window, window_data_x11->context); //fprintf(stdout, "GL Vendor: %s\n", glGetString(GL_VENDOR)); @@ -150,7 +150,7 @@ create_GL_context(SWindowData *window_data) { init_GL(window_data); - SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC) getProcAddressGLX("glXSwapIntervalEXT"); + SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC) glXGetProcAddress("glXSwapIntervalEXT"); set_target_fps_aux(); return true;