View Full Version : How to change window color bits in runtime?

10-07-2002, 01:36 PM
How to change window color bits in runtime?

10-07-2002, 01:45 PM
Draw something. Unless it's the same color as the background, it's gauranteed to change the window's color buffer at runtime.

10-07-2002, 06:44 PM
I mean how many colors. 16bit 24bit 32bit... got?

10-07-2002, 10:57 PM
Hi !

Do you mean that you want to change it from your application with a function call ?

You can do this on some Win32 platforms, but it is always a bit tricky, some applications are not very good at handling it, so the best thing is to stay away from it, or run your application in full screen mode.

If you only intend to run your own application, then it is of course up to you if you want to try it out.


10-07-2002, 11:24 PM
i think changing color depth of your window at runtime requires destroying your old and creating a new window, (i think) it's not possible or recommened to do that with one window

10-07-2002, 11:28 PM
oh the other possibility changing windows color depth...
call changedisplaysettings(...); to alter the current screen
call enumdisplaysettings(...); to retrieve information about the current screen

10-08-2002, 07:21 AM
ChangeDisplaySettings works fine on Windows98 and above (not sure about NT), but will not be able to change the color setting on Window95.

Also, when I change the color setting form the control panel while an OpenGL application is running, it continues to run. I guess the OS is actually smart enough to reallocate a new backbuffer at the new bit depth.

10-08-2002, 11:00 AM
When changing the color depth, while an OpenGL program is running, I've never had it work; always goes to a black window. I have to destroy the window and recreate it after changing the color depth.

10-08-2002, 01:45 PM
I guess creating a new window is the only safe way to do this. I know a dynamic color depth change works on an nForce running WinME and a TNT2 using Win95. I guess some drivers choose to due this and others don't. BTW, DFrey, what card do you use that just goes to a blank screen?

10-08-2002, 03:05 PM
I've had this behavior with a TNT using Win98, and a Geforce 2 MX using Win98, Win2k, and WinXP.