Getting screen resolutions


Is there a way to get a list of all possible screen resolutions that can be used, depending on the video card/monitor/OS ? I know how to do it with win32, but I’d like to do it with OpenGL or GLUT so it’s portable.

You cant retrieve this kind of information using OpenGL(or GLUT). Lookup MS GDI functions on MSDN for microsoft OSes.

Search MSDN for DEVMODE structure.

DEVMODE screen_settings;
int i = 0;

while(EnumScreenSettings(NULL,i,&screen_settings) != FALSE)
printf("%d: %dx%d %d bpp",i,screen_settings.dmPelsWidth,