Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <SDL2/SDL.h>
- int main(int argc, char *argv[])
- {
- SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
- if (SDL_Init(SDL_INIT_VIDEO) != 0) {
- std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
- return 1;
- }
- int d = SDL_GetNumVideoDisplays();
- SDL_Rect r;
- SDL_GetDisplayBounds(0, &r);
- SDL_Window * window = SDL_CreateWindow( "fullscreen", r.x, r.y, r.w, r.h, SDL_WINDOW_FULLSCREEN );
- if (window == NULL) {
- std::cout << "SDL_CreateWindow: " << SDL_GetError() << std::endl;
- }
- SDL_Surface* screenSurface = SDL_GetWindowSurface( window );
- SDL_FillRect( screenSurface, NULL, SDL_MapRGB( screenSurface->format, 0xFF, 0xFF, 0xFF ) );
- SDL_UpdateWindowSurface( window );
- SDL_Delay( 2000 );
- SDL_Quit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement