puyolzits

Untitled

Mar 14th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. int Graphics::CreateContext() {
  2.     window = SDL_CreateWindow("",
  3.         SDL_WINDOWPOS_UNDEFINED,
  4.         SDL_WINDOWPOS_UNDEFINED,
  5.         width,
  6.         height,
  7.         SDL_WINDOW_SHOWN);
  8.     renderer = SDL_CreateRenderer(window, -1, DEFAULT_RENDERER_FLAGS);
  9.  
  10.     if ((window == NULL) || (renderer == NULL))
  11.         return -1;
  12.     return 0;
  13. }
  14.  
  15. int Graphics::SwitchToFullscreen() {
  16.     return SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN);
  17. }
  18.  
  19. int Graphics::SwitchToWindowed() {
  20.     return SDL_SetWindowFullscreen(window, 0x0);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment