[SDL] How to get resolution of my SDL window?

neil at cloudsprinter.com neil at cloudsprinter.com
Wed Dec 5 03:27:11 PST 2007


Quoting voidstar <voidstar at tin.it>:

> Hello,
>
> I create my SDL window created with:
>
> surface_screen = SDL_SetVideoMode(MAX_X, MAX_Y, BPP,
>                 SDL_SWSURFACE|SDL_RESIZABLE);
>
> After some resizes I want to get new X and Y resolution of my window.
>
> I've tryed to do that using this Win32 function:
>
> RECT windowRect;
> GetWindowRect(hWnd, &windowRect);
> //To access members
> //windowRect.left
> //windowRect.right
> //windowRect.top
> //windowRect.bottom
>
> But this returns me the size of *all* the window, including window
> border/title.
>
> Is there an SDL/Win32 way to get X/Y resolution of my window?
>
> Thanks in advance
>
>

width=screen->w;

height=screen->h;

??



More information about the SDL mailing list