comparison src/video/wincommon/SDL_wingl_c.h @ 1895:c121d94672cb

SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 10 Jul 2006 21:04:37 +0000
parents 3b2a92126f4d
children
comparison
equal deleted inserted replaced
1894:c69cee13dd76 1895:c121d94672cb
24 /* WGL implementation of SDL OpenGL support */ 24 /* WGL implementation of SDL OpenGL support */
25 25
26 #include "../SDL_sysvideo.h" 26 #include "../SDL_sysvideo.h"
27 27
28 28
29 struct SDL_PrivateGLData { 29 struct SDL_PrivateGLData
30 int gl_active; /* to stop switching drivers while we have a valid context */ 30 {
31 int gl_active; /* to stop switching drivers while we have a valid context */
31 32
32 #if SDL_VIDEO_OPENGL 33 #if SDL_VIDEO_OPENGL
33 PIXELFORMATDESCRIPTOR GL_pfd; 34 PIXELFORMATDESCRIPTOR GL_pfd;
34 HDC GL_hdc; 35 HDC GL_hdc;
35 HGLRC GL_hrc; 36 HGLRC GL_hrc;
36 int pixel_format; 37 int pixel_format;
37 int WGL_ARB_pixel_format; 38 int WGL_ARB_pixel_format;
38 39
39 void * (WINAPI *wglGetProcAddress)(const char *proc); 40 void *(WINAPI * wglGetProcAddress) (const char *proc);
40 41
41 HGLRC (WINAPI *wglCreateContext)(HDC hdc); 42 HGLRC(WINAPI * wglCreateContext) (HDC hdc);
42 43
43 BOOL (WINAPI *wglDeleteContext)(HGLRC hglrc); 44 BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
44 45
45 BOOL (WINAPI *wglMakeCurrent)(HDC hdc, HGLRC hglrc); 46 BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
46 47
47 BOOL (WINAPI *wglChoosePixelFormatARB)(HDC hdc, const int *piAttribIList, 48 BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
48 const FLOAT *pfAttribFList, 49 const int *piAttribIList,
49 UINT nMaxFormats, int *piFormats, 50 const FLOAT * pfAttribFList,
50 UINT *nNumFormats); 51 UINT nMaxFormats,
51 BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat, 52 int *piFormats,
52 int iLayerPlane, 53 UINT * nNumFormats);
53 UINT nAttributes, 54 BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
54 const int *piAttributes, 55 int iLayerPlane,
55 int *piValues); 56 UINT nAttributes,
56 void (WINAPI *wglSwapIntervalEXT)(int interval); 57 const int *piAttributes,
57 int (WINAPI *wglGetSwapIntervalEXT)(void); 58 int *piValues);
58 #endif /* SDL_VIDEO_OPENGL */ 59 void (WINAPI * wglSwapIntervalEXT) (int interval);
60 int (WINAPI * wglGetSwapIntervalEXT) (void);
61 #endif /* SDL_VIDEO_OPENGL */
59 }; 62 };
60 63
61 /* Old variable names */ 64 /* Old variable names */
62 #define gl_active (this->gl_data->gl_active) 65 #define gl_active (this->gl_data->gl_active)
63 #define GL_pfd (this->gl_data->GL_pfd) 66 #define GL_pfd (this->gl_data->GL_pfd)
68 /* OpenGL functions */ 71 /* OpenGL functions */
69 extern int WIN_GL_SetupWindow(_THIS); 72 extern int WIN_GL_SetupWindow(_THIS);
70 extern void WIN_GL_ShutDown(_THIS); 73 extern void WIN_GL_ShutDown(_THIS);
71 #if SDL_VIDEO_OPENGL 74 #if SDL_VIDEO_OPENGL
72 extern int WIN_GL_MakeCurrent(_THIS); 75 extern int WIN_GL_MakeCurrent(_THIS);
73 extern int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); 76 extern int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
74 extern void WIN_GL_SwapBuffers(_THIS); 77 extern void WIN_GL_SwapBuffers(_THIS);
75 extern void WIN_GL_UnloadLibrary(_THIS); 78 extern void WIN_GL_UnloadLibrary(_THIS);
76 extern int WIN_GL_LoadLibrary(_THIS, const char* path); 79 extern int WIN_GL_LoadLibrary(_THIS, const char *path);
77 extern void *WIN_GL_GetProcAddress(_THIS, const char* proc); 80 extern void *WIN_GL_GetProcAddress(_THIS, const char *proc);
78 #endif 81 #endif
79 82
80 #if SDL_VIDEO_OPENGL 83 #if SDL_VIDEO_OPENGL
81 84
82 #ifndef WGL_ARB_pixel_format 85 #ifndef WGL_ARB_pixel_format
135 #define WGL_SAMPLE_BUFFERS_ARB 0x2041 138 #define WGL_SAMPLE_BUFFERS_ARB 0x2041
136 #define WGL_SAMPLES_ARB 0x2042 139 #define WGL_SAMPLES_ARB 0x2042
137 #endif 140 #endif
138 141
139 #endif 142 #endif
143 /* vi: set ts=4 sw=4 expandtab: */