Changing resolution

Hello all,

How do I change the desktop resoltion in glut? I need to change the resolution (say to 800 x 600) and then go into full screen mode.

I know how to create a window of any size and I also know how to go into full screen mode.

Hope you can help


You can’t do this in GLUT. You’ll need to use the Win32 API and call ChangeDisplaySettings.

Thanks, that seems to work.

Using ChangeDisplaySettings in Glut does work but are there any issues with this that I need to be aware of? It works on my machine (Win98 RivaTNT), would this work in Windows NT, or are there any compatability problems between Glut and Win32 API?



Sure it does work with glut, but it’s not a part of glut or OpenGL, so it’ll make your code less portable.

Don’t know for sure (I think it should work on all Win32 platforms) but these portability questions are mostly well answered in the online help of my MSDN copy.

BTW: WinNT and Win98 have multi-screen support, I think. But the ChangeDisplaySettings code should work as well, at least it does for me.

Oh and why does EnumDisplaySettings sometimes return more or less valid graphic modes?