PDA

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



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

*Aaron*
10-07-2002, 02: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, 07:44 PM
I mean how many colors. 16bit 24bit 32bit... got?

mikael_aronsson
10-07-2002, 11: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.

Mikael

powerpad
10-08-2002, 12:24 AM
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

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

*Aaron*
10-08-2002, 08: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.

DFrey
10-08-2002, 12:00 PM
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.

*Aaron*
10-08-2002, 02: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?

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