comparison src/video/x11/SDL_x11gl_c.h @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 96c2f89cc7e1
children 4da1ee79c9af
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
26 #include "SDL_loadso.h" 26 #include "SDL_loadso.h"
27 #endif 27 #endif
28 28
29 #include "../SDL_sysvideo.h" 29 #include "../SDL_sysvideo.h"
30 30
31 struct SDL_PrivateGLData { 31 struct SDL_PrivateGLData
32 int gl_active; /* to stop switching drivers while we have a valid context */ 32 {
33 int gl_active; /* to stop switching drivers while we have a valid context */
33 34
34 #if SDL_VIDEO_OPENGL_GLX 35 #if SDL_VIDEO_OPENGL_GLX
35 GLXContext glx_context; /* Current GL context */ 36 GLXContext glx_context; /* Current GL context */
36 XVisualInfo* glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */ 37 XVisualInfo *glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */
37 38
38 void * (*glXGetProcAddress)(const GLubyte *procName); 39 void *(*glXGetProcAddress) (const GLubyte * procName);
39 40
40 XVisualInfo* (*glXChooseVisual) 41 XVisualInfo *(*glXChooseVisual)
41 ( Display* dpy, 42 (Display * dpy, int screen, int *attribList);
42 int screen,
43 int* attribList );
44 43
45 GLXContext (*glXCreateContext) 44 GLXContext (*glXCreateContext)
46 ( Display* dpy, 45 (Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool direct);
47 XVisualInfo* vis,
48 GLXContext shareList,
49 Bool direct );
50 46
51 void (*glXDestroyContext) 47 void (*glXDestroyContext) (Display * dpy, GLXContext ctx);
52 ( Display* dpy,
53 GLXContext ctx );
54 48
55 Bool (*glXMakeCurrent) 49 Bool (*glXMakeCurrent)
56 ( Display* dpy, 50 (Display * dpy, GLXDrawable drawable, GLXContext ctx);
57 GLXDrawable drawable,
58 GLXContext ctx );
59 51
60 void (*glXSwapBuffers) 52 void (*glXSwapBuffers) (Display * dpy, GLXDrawable drawable);
61 ( Display* dpy,
62 GLXDrawable drawable );
63 53
64 int (*glXGetConfig) 54 int (*glXGetConfig)
65 ( Display* dpy, 55 (Display * dpy, XVisualInfo * visual_info, int attrib, int *value);
66 XVisualInfo* visual_info,
67 int attrib,
68 int* value );
69 56
70 const char *(*glXQueryExtensionsString) 57 const char *(*glXQueryExtensionsString) (Display * dpy, int screen);
71 ( Display* dpy,
72 int screen );
73 58
74 int (*glXSwapIntervalSGI) ( int interval ); 59 int (*glXSwapIntervalSGI) (int interval);
75 GLint (*glXSwapIntervalMESA) ( unsigned interval ); 60 GLint (*glXSwapIntervalMESA) (unsigned interval);
76 GLint (*glXGetSwapIntervalMESA) ( void ); 61 GLint (*glXGetSwapIntervalMESA) (void);
77 62
78 #endif /* SDL_VIDEO_OPENGL_GLX */ 63 #endif /* SDL_VIDEO_OPENGL_GLX */
79 }; 64 };
80 65
81 /* Old variable names */ 66 /* Old variable names */
82 #define gl_active (this->gl_data->gl_active) 67 #define gl_active (this->gl_data->gl_active)
83 #define glx_context (this->gl_data->glx_context) 68 #define glx_context (this->gl_data->glx_context)
84 #define glx_visualinfo (this->gl_data->glx_visualinfo) 69 #define glx_visualinfo (this->gl_data->glx_visualinfo)
85 70
86 /* OpenGL functions */ 71 /* OpenGL functions */
87 extern XVisualInfo *X11_GL_GetVisual(_THIS); 72 extern XVisualInfo *X11_GL_GetVisual (_THIS);
88 extern int X11_GL_CreateWindow(_THIS, int w, int h); 73 extern int X11_GL_CreateWindow (_THIS, int w, int h);
89 extern int X11_GL_CreateContext(_THIS); 74 extern int X11_GL_CreateContext (_THIS);
90 extern void X11_GL_Shutdown(_THIS); 75 extern void X11_GL_Shutdown (_THIS);
91 #if SDL_VIDEO_OPENGL_GLX 76 #if SDL_VIDEO_OPENGL_GLX
92 extern int X11_GL_MakeCurrent(_THIS); 77 extern int X11_GL_MakeCurrent (_THIS);
93 extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); 78 extern int X11_GL_GetAttribute (_THIS, SDL_GLattr attrib, int *value);
94 extern void X11_GL_SwapBuffers(_THIS); 79 extern void X11_GL_SwapBuffers (_THIS);
95 extern int X11_GL_LoadLibrary(_THIS, const char* path); 80 extern int X11_GL_LoadLibrary (_THIS, const char *path);
96 extern void *X11_GL_GetProcAddress(_THIS, const char* proc); 81 extern void *X11_GL_GetProcAddress (_THIS, const char *proc);
97 #endif 82 #endif
98 extern void X11_GL_UnloadLibrary(_THIS); 83 extern void X11_GL_UnloadLibrary (_THIS);
99 84 /* vi: set ts=4 sw=4 expandtab: */