Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <iostream>
  2. #include <SDL2/SDL.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
  7.  
  8. if (SDL_Init(SDL_INIT_VIDEO) != 0) {
  9. std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
  10. return 1;
  11. }
  12.  
  13. int d = SDL_GetNumVideoDisplays();
  14. SDL_Rect r;
  15. SDL_GetDisplayBounds(0, &r);
  16. SDL_Window * window = SDL_CreateWindow( "fullscreen", r.x, r.y, r.w, r.h, SDL_WINDOW_FULLSCREEN );
  17. if (window == NULL) {
  18. std::cout << "SDL_CreateWindow: " << SDL_GetError() << std::endl;
  19.  
  20. }
  21. SDL_Surface* screenSurface = SDL_GetWindowSurface( window );
  22. SDL_FillRect( screenSurface, NULL, SDL_MapRGB( screenSurface->format, 0xFF, 0xFF, 0xFF ) );
  23. SDL_UpdateWindowSurface( window );
  24. SDL_Delay( 2000 );
  25.  
  26. SDL_Quit();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement