src/video/x11/SDL_x11opengl.c
changeset 5981 75caa8a7d559
parent 5630 39e74dab5ebb
child 6044 35448a5ea044
equal deleted inserted replaced
5980:612b41c44af1 5981:75caa8a7d559
    17   2. Altered source versions must be plainly marked as such, and must not be
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    20 */
    21 #include "SDL_config.h"
    21 #include "SDL_config.h"
    22 
       
    23 #include "SDL_x11video.h"
    22 #include "SDL_x11video.h"
       
    23 #include "SDL_assert.h"
    24 
    24 
    25 /* GLX implementation of SDL OpenGL support */
    25 /* GLX implementation of SDL OpenGL support */
    26 
    26 
    27 #if SDL_VIDEO_OPENGL_GLX
    27 #if SDL_VIDEO_OPENGL_GLX
    28 #include "SDL_loadso.h"
    28 #include "SDL_loadso.h"
   386 X11_GL_GetVisual(_THIS, Display * display, int screen)
   386 X11_GL_GetVisual(_THIS, Display * display, int screen)
   387 {
   387 {
   388     XVisualInfo *vinfo;
   388     XVisualInfo *vinfo;
   389 
   389 
   390     /* 64 seems nice. */
   390     /* 64 seems nice. */
   391     int attribs[64];
   391     const int max_attrs = 64;
   392     int i = X11_GL_GetAttributes(_this,display,screen,attribs,64);
   392     int attribs[max_attrs];
       
   393     const int i = X11_GL_GetAttributes(_this,display,screen,attribs,max_attrs);
       
   394     SDL_assert(i <= max_attrs);
   393 
   395 
   394     vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs);
   396     vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs);
   395     if (!vinfo) {
   397     if (!vinfo) {
   396         SDL_SetError("Couldn't find matching GLX visual");
   398         SDL_SetError("Couldn't find matching GLX visual");
   397     }
   399     }