Mercurial > sdl-ios-xcode
comparison test/testgl2.c @ 2178:114a541cfae2
Creating a context makes it current, per the documentation.
Applied a variant of the multi-card OpenGL fix from SDL 1.2
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 12 Jul 2007 06:31:36 +0000 |
parents | 8055185ae4ed |
children | bb67fd5ccfdb |
comparison
equal
deleted
inserted
replaced
2177:4f896c20caf6 | 2178:114a541cfae2 |
---|---|
223 context = SDL_GL_CreateContext(state->windows[0]); | 223 context = SDL_GL_CreateContext(state->windows[0]); |
224 if (!context) { | 224 if (!context) { |
225 fprintf(stderr, "SDL_GL_CreateContext(): %s\n", SDL_GetError()); | 225 fprintf(stderr, "SDL_GL_CreateContext(): %s\n", SDL_GetError()); |
226 quit(2); | 226 quit(2); |
227 } | 227 } |
228 if (SDL_GL_MakeCurrent(state->windows[0], context) < 0) { | |
229 fprintf(stderr, "SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); | |
230 quit(2); | |
231 } | |
232 | 228 |
233 if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) { | 229 if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) { |
234 SDL_GL_SetSwapInterval(1); | 230 SDL_GL_SetSwapInterval(1); |
235 } else { | 231 } else { |
236 SDL_GL_SetSwapInterval(0); | 232 SDL_GL_SetSwapInterval(0); |