How to change window color bits in runtime?

How to change window color bits in runtime?

Draw something. Unless it’s the same color as the background, it’s gauranteed to change the window’s color buffer at runtime.

I mean how many colors. 16bit 24bit 32bit… got?

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.

Mikael

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

oh the other possibility changing windows color depth…
call changedisplaysettings(…); to alter the current screen
call enumdisplaysettings(…); to retrieve information about the current screen

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.

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.

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?

I’ve had this behavior with a TNT using Win98, and a Geforce 2 MX using Win98, Win2k, and WinXP.