Merge pull request #60 from onbjerg/linux-gl-context

Properly create OpenGL context on Linux
This commit is contained in:
Carlos Aragonés 2021-05-05 23:05:43 +02:00 committed by GitHub
commit 571690a513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;