Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_wingl_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 |
---|---|
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) |
64 #define GL_hdc (this->gl_data->GL_hdc) | 67 #define GL_hdc (this->gl_data->GL_hdc) |
65 #define GL_hrc (this->gl_data->GL_hrc) | 68 #define GL_hrc (this->gl_data->GL_hrc) |
66 #define pixel_format (this->gl_data->pixel_format) | 69 #define pixel_format (this->gl_data->pixel_format) |
67 | 70 |
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: */ |