| Summary: | X11_GL_GetAttributes is wrongly implemented | ||
|---|---|---|---|
| Product: | SDL | Reporter: | the_isz |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P1 | CC: | icculus |
| Version: | HG 2.0 | Keywords: | target-2.0.0 |
| Hardware: | x86_64 | ||
| OS: | Linux | ||
Thanks for the report. Why weren't you able to confirm that the patch works? 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 (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. This is fixed awhile ago in http://hg.libsdl.org/SDL/rev/b42657486c0d --ryan. |
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)