[SDL] Find Current Resolution

Sam Lantinga slouken at devolution.com
Sun Dec 12 23:01:12 PST 2004


There's a crucial bit of information missing.  (added below)

> #include <SDL_syswm.h>
>                                                                                
>                                                       
> int main()
> {
>         SDL_SysWMinfo   info;
>         int width;
>         int height;
>                                                                                
>                                                       
	SDL_VERSION(&info.version);
>         SDL_GetWMInfo(&info);
>         width = DisplayWidth(info.info.x11.display, 0);
>         height = DisplayHeight(info.info.x11.display, 0);
>                                                                                
>                                                       
>         printf("Width = %d, Height = %d\n", width, height);
>                                                                                
>                                                       
>         return 0;
> }




More information about the SDL mailing list