Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32opengl.c @ 1926:307355678142
Added SDL_GL_ExtensionSupported()
Use GL_ARB_texture_rectangle in the OpenGL renderer, if supported.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 22 Jul 2006 21:58:17 +0000 |
parents | 83420da906a5 |
children | 83946ee0ff1f |
comparison
equal
deleted
inserted
replaced
1925:411bfb37082b | 1926:307355678142 |
---|---|
194 HDC hdc; | 194 HDC hdc; |
195 PIXELFORMATDESCRIPTOR pfd; | 195 PIXELFORMATDESCRIPTOR pfd; |
196 int pixel_format; | 196 int pixel_format; |
197 HGLRC hglrc; | 197 HGLRC hglrc; |
198 const char *(WINAPI * wglGetExtensionsStringARB) (HDC) = 0; | 198 const char *(WINAPI * wglGetExtensionsStringARB) (HDC) = 0; |
199 const GLubyte *(WINAPI * glGetStringFunc) (GLenum); | |
200 const char *extensions; | 199 const char *extensions; |
201 | 200 |
202 hwnd = | 201 hwnd = |
203 CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0, | 202 CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0, |
204 10, 10, NULL, NULL, SDL_Instance, NULL); | 203 10, 10, NULL, NULL, SDL_Instance, NULL); |
239 (_this->gl_data->wglGetPixelFormatAttribivARB != NULL)) { | 238 (_this->gl_data->wglGetPixelFormatAttribivARB != NULL)) { |
240 _this->gl_data->WGL_ARB_pixel_format = 1; | 239 _this->gl_data->WGL_ARB_pixel_format = 1; |
241 } | 240 } |
242 } | 241 } |
243 | 242 |
244 glGetStringFunc = WIN_GL_GetProcAddress(_this, "glGetString"); | |
245 if (glGetStringFunc) { | |
246 extensions = (const char *) glGetStringFunc(GL_EXTENSIONS); | |
247 } else { | |
248 /* Uh oh, something is seriously wrong here... */ | |
249 extensions = NULL; | |
250 } | |
251 | |
252 /* Check for WGL_EXT_swap_control */ | 243 /* Check for WGL_EXT_swap_control */ |
253 if (HasExtension("WGL_EXT_swap_control", extensions)) { | 244 if (HasExtension("WGL_EXT_swap_control", extensions)) { |
254 _this->gl_data->wglSwapIntervalEXT = | 245 _this->gl_data->wglSwapIntervalEXT = |
255 WIN_GL_GetProcAddress(_this, "wglSwapIntervalEXT"); | 246 WIN_GL_GetProcAddress(_this, "wglSwapIntervalEXT"); |
256 _this->gl_data->wglGetSwapIntervalEXT = | 247 _this->gl_data->wglGetSwapIntervalEXT = |