From 1855778fa7439c308b8a79282163c52f5f93f0c6 Mon Sep 17 00:00:00 2001 From: Roz K Date: Mon, 19 Sep 2022 02:25:52 +0200 Subject: [PATCH] Fix GL extensions listing. --- cpp/opengl/render_context_glx.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cpp/opengl/render_context_glx.cpp b/cpp/opengl/render_context_glx.cpp index 93ddba0..78cfb4f 100644 --- a/cpp/opengl/render_context_glx.cpp +++ b/cpp/opengl/render_context_glx.cpp @@ -161,14 +161,14 @@ rk_window_t rk_create_context( XStoreName(rk_display, rk_window, name); XMapWindow(rk_display, rk_window); - char const * const glxExts = glXQueryExtensionsString(rk_display, DefaultScreen(rk_display)); + char const * const glx_exts = glXQueryExtensionsString(rk_display, DefaultScreen(rk_display)); glXCreateContextAttribsARBProc const glXCreateContextAttribsARB = reinterpret_cast( glXGetProcAddressARB(reinterpret_cast("glXCreateContextAttribsARB"))); rk_error_occured = false; int (*oldHandler)(Display *, XErrorEvent *) = XSetErrorHandler(&rk_error_handler); - if (!rk_extension_supported(glxExts, "GLX_ARB_create_context") || !glXCreateContextAttribsARB) { + if (!rk_extension_supported(glx_exts, "GLX_ARB_create_context") || !glXCreateContextAttribsARB) { rk_printf("glXCreateContextAttribsARB() extension not found."); rk_destroy_context(); return nullptr; @@ -188,13 +188,14 @@ rk_window_t rk_create_context( } glXMakeCurrent(rk_display, rk_window, rk_context); - if (rk_extension_supported(glxExts, "GL_EXT_base_instance")) { + char const * const gl_exts = reinterpret_cast(glGetString(GL_EXTENSIONS)); + if (rk_extension_supported(gl_exts, "GL_EXT_base_instance")) { rk_DrawElementsInstancedBaseInstance = reinterpret_cast( glXGetProcAddressARB(reinterpret_cast("DrawElementsInstancedBaseInstance"))); if (rk_DrawElementsInstancedBaseInstance) { rk_printf("Using extension GL_EXT_base_instance::DrawElementsInstancedBaseInstance."); - if (rk_extension_supported(glxExts, "GL_EXT_multi_draw_indirect")) { + if (rk_extension_supported(gl_exts, "GL_EXT_multi_draw_indirect")) { rk_MultiDrawElementsIndirect = reinterpret_cast( glXGetProcAddressARB(reinterpret_cast("MultiDrawElementsIndirectEXT")));