comparison src/video/SDL_video.c @ 1913:83420da906a5

Implemented Windows OpenGL support Fixed slowdown enumerating display modes, which was hosing OpenGL as well... Removed SDL_ from the render driver prefixes
author Sam Lantinga <slouken@libsdl.org>
date Mon, 17 Jul 2006 06:47:33 +0000
parents 8d384b647307
children 092bd3a019c5
comparison
equal deleted inserted replaced
1912:8d384b647307 1913:83420da906a5
2115 2115
2116 if (!window) { 2116 if (!window) {
2117 return -1; 2117 return -1;
2118 } 2118 }
2119 2119
2120 if (_this->GL_GetAttribute) { 2120 if (_this->GL_GetWindowAttribute) {
2121 retval = _this->GL_GetAttribute(_this, attr, value); 2121 retval = _this->GL_GetWindowAttribute(_this, window, attr, value);
2122 } else { 2122 } else {
2123 *value = 0; 2123 *value = 0;
2124 SDL_SetError("GL_GetAttribute not supported"); 2124 SDL_SetError("GL_GetWindowAttribute not supported");
2125 retval = -1; 2125 retval = -1;
2126 } 2126 }
2127 return retval; 2127 return retval;
2128 } 2128 }
2129 2129
2145 int 2145 int
2146 SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context) 2146 SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context)
2147 { 2147 {
2148 SDL_Window *window = SDL_GetWindowFromID(windowID); 2148 SDL_Window *window = SDL_GetWindowFromID(windowID);
2149 2149
2150 if (!window || !context) { 2150 if (window && !(window->flags & SDL_WINDOW_OPENGL)) {
2151 return -1;
2152 }
2153 if (!(window->flags & SDL_WINDOW_OPENGL)) {
2154 SDL_SetError("The specified window isn't an OpenGL window"); 2151 SDL_SetError("The specified window isn't an OpenGL window");
2155 return -1; 2152 return -1;
2156 } 2153 }
2157 return _this->GL_MakeCurrent(_this, window, context); 2154 return _this->GL_MakeCurrent(_this, window, context);
2158 } 2155 }