Setting up VSYNC with SDL_CreateWindowAndRenderer |
mr_tawan
|
You can use `SDL_CreateWindow()` and `SDL_CreateRenderer()` to archive the same thing.
|
|||||||||||||
|
mbabuskov
|
That code creates a 640x480 pixel window. I want to run the game in fullscreen. Thanks. |
|||||||||||||||
|
mbabuskov
|
I just discovered that you cannot edit forum posts, so I'll be more careful. That code makes the game run at 640x480 resolution. I want to keep the native desktop resolution. How can I achieve that? |
|||||||||||||||
|
mr_tawan
|
I supposed you already have the code that use SDL_CreateWindowAndRenderer() already. You can use the same w, h, and Window flag parameters with the SDL_CreateWindow(). Then create the renderer with SDL_CreateRenderer().
|
|||||||||||
|
mbabuskov
|
The whole point was that I did not know what to use for X and Y values because I wanted current desktop resolution. I could get it with SDL_GetDesktopDisplayMode, but if user has multiple monitors I don't know on which monitor will the game show up. However, I discovered SDL_WINDOW_FULLSCREEN_DESKTOP which actually does what I want. So, problem is solved. |
|||||||||||||
|