|
|
commit 0fdc88d2d7b55c0d90a138117b90c798901366a7
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Fri Sep 23 18:09:40 2022 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Fri Sep 23 18:09:40 2022 +0200
GL3 support under X11: ask for compatibility profile if possible.
src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
index 597801a..476d654 100644
--- src/drivers/X11/Fl_X11_Gl_Window_Driver.cxx
+++ 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
[ Direct Link to Message ] | |
|
| |