LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Get window size with tiling window manager in SDL (https://www.linuxquestions.org/questions/programming-9/get-window-size-with-tiling-window-manager-in-sdl-4175446810/)

Snark1994 01-22-2013 06:07 PM

Get window size with tiling window manager in SDL
 
Hiya,

I have an SDL application, and it's important for it to know the dimensions of its draw area. I request a window of 600x600, but because I'm using a tiling window manager this is rarely if ever what I actually get. Once the window is resized by the window manager (i.e. changing its position, or setting it to floating) then the SDL_VIDEORESIZE event is triggered and everything works perfectly. However, I can't find any way of getting the actual window size before this occurs. I am using SDL 1.12.15.

Code:

w = SDL_GetVideoInfo()->current_w;
Code:

w = SDL_GetVideoSurface()->w
Code:

w = screen->w;
All of the above seem to provide the requested width, not the actual width.

Finally,

Code:

SDL_GetWindowSize(screen,w,h)
is only supported in SDL 2.0 so even if it does work, it isn't really an option here.

Any ideas?

Thanks,

jorants 02-24-2013 08:46 PM

This is kind of freaky, have the exact same thing, also using 600x600 as default.
Anyway, if i find the answer i will tell you ;-)


All times are GMT -5. The time now is 07:02 PM.