summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-23 18:09:40 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-23 18:09:40 +0200
commit0fdc88d2d7b55c0d90a138117b90c798901366a7 (patch)
tree94ba0f87675324567072c46d558fea3d15c83a41 /src/drivers
parent6472f9b041d963436752b01373331e55a04bc99a (diff)
GL3 support under X11: ask for compatibility profile if possible.
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
index 597801a0f..476d654f3 100644
--- a/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
@@ -278,7 +278,7 @@ GLContext Fl_X11_Gl_Window_Driver::create_gl_context(Fl_Window* window, const Fl
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 2,
//GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
- //GLX_CONTEXT_PROFILE_MASK_ARB , GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+ GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
None
};
ctxErrorOccurred = false;
@@ -286,6 +286,12 @@ GLContext Fl_X11_Gl_Window_Driver::create_gl_context(Fl_Window* window, const Fl
ctx = glXCreateContextAttribsARB(fl_display, ((Fl_X11_Gl_Choice*)g)->best_fb, shared_ctx, true, context_attribs);
XSync(fl_display, false); // Sync to ensure any errors generated are processed.
if (ctxErrorOccurred) ctx = 0;
+ if (!ctx) { // if did not work, try again asking for core profile
+ ctxErrorOccurred = false;
+ context_attribs[5] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
+ ctx = glXCreateContextAttribsARB(fl_display, ((Fl_X11_Gl_Choice*)g)->best_fb, shared_ctx, true, context_attribs);
+ if (ctxErrorOccurred) ctx = 0;
+ }
XSetErrorHandler(oldHandler);
}
if (!ctx) { // use OpenGL 1-style context creation