src/video/x11/SDL_x11opengl.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 28 Jul 2006 08:46:24 +0000
changeset 1953 214880ed48c3
parent 1952 420716272158
child 2859 99210400e8b9
permissions -rw-r--r--
We're not querying the glX attributes anymore...
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_x11opengl_h
    25 #define _SDL_x11opengl_h
    26 
    27 #if SDL_VIDEO_OPENGL_GLX
    28 #include "SDL_opengl.h"
    29 #include <GL/glx.h>
    30 
    31 struct SDL_GLDriverData
    32 {
    33     int initialized;
    34     SDL_bool HAS_GLX_EXT_visual_rating;
    35 
    36     void *(*glXGetProcAddress) (const GLubyte * procName);
    37 
    38     XVisualInfo *(*glXChooseVisual)
    39       (Display * dpy, int screen, int *attribList);
    40 
    41       GLXContext(*glXCreateContext)
    42       (Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool direct);
    43 
    44     void (*glXDestroyContext)
    45       (Display * dpy, GLXContext ctx);
    46 
    47       Bool(*glXMakeCurrent)
    48       (Display * dpy, GLXDrawable drawable, GLXContext ctx);
    49 
    50     void (*glXSwapBuffers)
    51       (Display * dpy, GLXDrawable drawable);
    52 
    53     int (*glXSwapIntervalSGI) (int interval);
    54       GLint(*glXSwapIntervalMESA) (unsigned interval);
    55       GLint(*glXGetSwapIntervalMESA) (void);
    56 };
    57 
    58 /* OpenGL functions */
    59 extern int X11_GL_LoadLibrary(_THIS, const char *path);
    60 extern void *X11_GL_GetProcAddress(_THIS, const char *proc);
    61 extern int X11_GL_Initialize(_THIS);
    62 extern void X11_GL_Shutdown(_THIS);
    63 extern XVisualInfo *X11_GL_GetVisual(_THIS, Display * display, int screen);
    64 extern SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window * window);
    65 extern int X11_GL_MakeCurrent(_THIS, SDL_Window * window,
    66                               SDL_GLContext context);
    67 extern int X11_GL_SetSwapInterval(_THIS, int interval);
    68 extern int X11_GL_GetSwapInterval(_THIS);
    69 extern void X11_GL_SwapWindow(_THIS, SDL_Window * window);
    70 extern void X11_GL_DeleteContext(_THIS, SDL_GLContext context);
    71 
    72 #endif /* SDL_VIDEO_OPENGL_GLX */
    73 
    74 #endif /* _SDL_x11opengl_h */
    75 
    76 /* vi: set ts=4 sw=4 expandtab: */