We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1325 - X11_GL_GetAttributes is wrongly implemented
Summary: X11_GL_GetAttributes is wrongly implemented
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P1 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2011-11-04 03:44 UTC by the_isz
Modified: 2013-07-15 01:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description the_isz 2011-11-04 03:44:34 UTC
Comparing the implementation of X11_GL_GetAttributes (in
src/video/x11/SDL_x11opengl.c) with the tutorial on the opengl.org website for
creating an OpenGL 3 context [1] and the documentation of glXChooseFBConfig [2],
I'm pretty sure there's something seriously wrong.

My patch suggestion looks like this:

---- snip ---

--- src/video/x11/SDL_x11opengl.c	2011-04-08 22:07:04.000000000 +0200
+++ src/video/x11/SDL_x11opengl.c	2011-11-04 11:39:15.271395764 +0100
@@ -292,7 +292,8 @@
     /* assert(size >= 32);*/
 
     /* Setup our GLX attributes according to the gl_config. */
-    attribs[i++] = GLX_RGBA;
+    attribs[i++] = GLX_RENDER_TYPE;
+    attribs[i++] = GLX_RGBA_BIT;
     attribs[i++] = GLX_RED_SIZE;
     attribs[i++] = _this->gl_config.red_size;
     attribs[i++] = GLX_GREEN_SIZE;
@@ -312,6 +313,7 @@
 
     if (_this->gl_config.double_buffer) {
         attribs[i++] = GLX_DOUBLEBUFFER;
+        attribs[i++] = True;
     }
 
     attribs[i++] = GLX_DEPTH_SIZE;
@@ -344,6 +346,7 @@
 
     if (_this->gl_config.stereo) {
         attribs[i++] = GLX_STEREO;
+        attribs[i++] = True;
     }
 
     if (_this->gl_config.multisamplebuffers) {

--- snap ---

Unfortunately, I wasn't able to confirm the patch works.

I assume that this bug is the reason for me not being able to obtain an OpenGL
3.2 context with the SDL tutorial program [3]. It always gives me
"No good framebuffers found. GL 3.x disabled", although I was able to obtain an
OpenGL 3.2 context with the plain Xlib program [1].

[1] http://www.opengl.org/wiki/Tutorial:_OpenGL_3.0_Context_Creation_(GLX)
[2] http://www.opengl.org/sdk/docs/man/xhtml/glXChooseFBConfig.xml
[3] http://www.opengl.org/wiki/Tutorial1:_Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL_(C_/_SDL)
Comment 1 Sam Lantinga 2012-01-07 19:58:03 UTC
Thanks for the report.  Why weren't you able to confirm that the patch works?
Comment 2 the_isz 2012-01-08 11:07:42 UTC
Hi Sam,

I couldn't confirm the patch works because it wasn't the only problem I was
having. Thus, I never got a working sample. Also, debugging my code wasn't
possible for me because I wasn't able to compile a debugging version of SDL (see
the other issue I reported).

Regards,

Timo
Comment 3 Ryan C. Gordon 2013-07-12 18:52:44 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 1.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 4 Ryan C. Gordon 2013-07-15 01:16:33 UTC
This is fixed awhile ago in http://hg.libsdl.org/SDL/rev/b42657486c0d

--ryan.