in previously versions of SDL I was able to get the height and width of my problem using the main surface, which had a clip_rect member. Since 2.0 I am using SDL_Renderer & SDL_Window.
How do I get the window size or even better the rect of my current program?
To get the height and width of the window:
void SDL_GetWindowSize(SDL_Window* window,int* w,int* h)
You can look here for more functions for whatever you want that deals with windows. https://wiki.libsdl.org/CategoryVideo
If you're just looking for width and height and anything else you'd normally find within an SDL_Surface
this works just as well, if not better:
Width:
SDL_GetWindowSurface(m_window)->w;
Height:
SDL_GetWindowSurface(m_window)->h;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With