src/video/SDL_video.c
changeset 5570 70b6f92e4539
parent 5563 2a152e7e82f2
child 5571 a036283f779d
equal deleted inserted replaced
5567:441c3036440c 5570:70b6f92e4539
  2457 }
  2457 }
  2458 
  2458 
  2459 SDL_GLContext
  2459 SDL_GLContext
  2460 SDL_GL_CreateContext(SDL_Window * window)
  2460 SDL_GL_CreateContext(SDL_Window * window)
  2461 {
  2461 {
       
  2462     SDL_GLContext ctx = NULL;
  2462     CHECK_WINDOW_MAGIC(window, NULL);
  2463     CHECK_WINDOW_MAGIC(window, NULL);
  2463 
  2464 
  2464     if (!(window->flags & SDL_WINDOW_OPENGL)) {
  2465     if (!(window->flags & SDL_WINDOW_OPENGL)) {
  2465         SDL_SetError("The specified window isn't an OpenGL window");
  2466         SDL_SetError("The specified window isn't an OpenGL window");
  2466         return NULL;
  2467         return NULL;
  2467     }
  2468     }
  2468     return _this->GL_CreateContext(_this, window);
  2469 
       
  2470     ctx = _this->GL_CreateContext(_this, window);
       
  2471 
       
  2472     /* Creating a context is assumed to make it current in the SDL driver. */
       
  2473     _this->current_glwin = window;
       
  2474     _this->current_glctx = ctx;
       
  2475 
       
  2476     return ctx;
  2469 }
  2477 }
  2470 
  2478 
  2471 int
  2479 int
  2472 SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx)
  2480 SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx)
  2473 {
  2481 {