Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Record the new OpenGL context as current during SDL_GL_CreateContext().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 18, 2011
1 parent 2d004d7 commit 6662f4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/video/SDL_video.c
Expand Up @@ -2459,13 +2459,21 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
SDL_GLContext
SDL_GL_CreateContext(SDL_Window * window)
{
SDL_GLContext ctx = NULL;
CHECK_WINDOW_MAGIC(window, NULL);

if (!(window->flags & SDL_WINDOW_OPENGL)) {
SDL_SetError("The specified window isn't an OpenGL window");
return NULL;
}
return _this->GL_CreateContext(_this, window);

ctx = _this->GL_CreateContext(_this, window);

/* Creating a context is assumed to make it current in the SDL driver. */
_this->current_glwin = window;
_this->current_glctx = ctx;

return ctx;
}

int
Expand Down

0 comments on commit 6662f4d

Please sign in to comment.