comparison src/video/wincommon/SDL_wingl.c @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents c71e05b4dc2e
children c0a74f199ecf
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* WGL implementation of SDL OpenGL support */ 23 /* WGL implementation of SDL OpenGL support */
24 24
25 #ifdef HAVE_OPENGL 25 #if SDL_VIDEO_OPENGL
26 #include "SDL_opengl.h" 26 #include "SDL_opengl.h"
27 #endif 27 #endif
28 #include "SDL_lowvideo.h" 28 #include "SDL_lowvideo.h"
29 #include "SDL_wingl_c.h" 29 #include "SDL_wingl_c.h"
30 30
31 #ifdef HAVE_OPENGL 31 #if SDL_VIDEO_OPENGL
32 #define DEFAULT_GL_DRIVER_PATH "OPENGL32.DLL" 32 #define DEFAULT_GL_DRIVER_PATH "OPENGL32.DLL"
33 #endif 33 #endif
34 34
35 /* If setting the HDC fails, we may need to recreate the window (MSDN) */ 35 /* If setting the HDC fails, we may need to recreate the window (MSDN) */
36 static int WIN_GL_ResetWindow(_THIS) 36 static int WIN_GL_ResetWindow(_THIS)
67 status = -1; 67 status = -1;
68 } 68 }
69 return(status); 69 return(status);
70 } 70 }
71 71
72 #ifdef HAVE_OPENGL 72 #if SDL_VIDEO_OPENGL
73 73
74 static int ExtensionSupported(const char *extension, const char *extensions) 74 static int ExtensionSupported(const char *extension, const char *extensions)
75 { 75 {
76 const char *start; 76 const char *start;
77 const char *where, *terminator; 77 const char *where, *terminator;
157 } 157 }
158 ReleaseDC(hwnd, hdc); 158 ReleaseDC(hwnd, hdc);
159 DestroyWindow(hwnd); 159 DestroyWindow(hwnd);
160 } 160 }
161 161
162 #endif /* HAVE_OPENGL */ 162 #endif /* SDL_VIDEO_OPENGL */
163 163
164 int WIN_GL_SetupWindow(_THIS) 164 int WIN_GL_SetupWindow(_THIS)
165 { 165 {
166 int retval; 166 int retval;
167 #ifdef HAVE_OPENGL 167 #if SDL_VIDEO_OPENGL
168 int i; 168 int i;
169 unsigned int matching; 169 unsigned int matching;
170 int iAttribs[64]; 170 int iAttribs[64];
171 int *iAttr; 171 int *iAttr;
172 float fAttribs[1] = { 0 }; 172 float fAttribs[1] = { 0 };
328 return(retval); 328 return(retval);
329 } 329 }
330 330
331 void WIN_GL_ShutDown(_THIS) 331 void WIN_GL_ShutDown(_THIS)
332 { 332 {
333 #ifdef HAVE_OPENGL 333 #if SDL_VIDEO_OPENGL
334 /* Clean up OpenGL */ 334 /* Clean up OpenGL */
335 if ( GL_hrc ) { 335 if ( GL_hrc ) {
336 this->gl_data->wglMakeCurrent(NULL, NULL); 336 this->gl_data->wglMakeCurrent(NULL, NULL);
337 this->gl_data->wglDeleteContext(GL_hrc); 337 this->gl_data->wglDeleteContext(GL_hrc);
338 GL_hrc = NULL; 338 GL_hrc = NULL;
342 GL_hdc = NULL; 342 GL_hdc = NULL;
343 } 343 }
344 gl_active = 0; 344 gl_active = 0;
345 345
346 WIN_GL_UnloadLibrary(this); 346 WIN_GL_UnloadLibrary(this);
347 #endif /* HAVE_OPENGL */ 347 #endif /* SDL_VIDEO_OPENGL */
348 } 348 }
349 349
350 #ifdef HAVE_OPENGL 350 #if SDL_VIDEO_OPENGL
351 351
352 /* Make the current context active */ 352 /* Make the current context active */
353 int WIN_GL_MakeCurrent(_THIS) 353 int WIN_GL_MakeCurrent(_THIS)
354 { 354 {
355 int retval; 355 int retval;
567 func = GetProcAddress(this->gl_config.dll_handle, proc); 567 func = GetProcAddress(this->gl_config.dll_handle, proc);
568 } 568 }
569 return func; 569 return func;
570 } 570 }
571 571
572 #endif /* HAVE_OPENGL */ 572 #endif /* SDL_VIDEO_OPENGL */