I am currently writing a driver for our 3D engine (which is currently Windows) and have split the whole framework into the following classes:
base application - this handles the platform specific creation/destruction of windows.
application - this is derived from base application and includes driver enumeration and calls the correct parts of the driver.
We then have the driver which can be swapped in and out of memory with other drivers.
I am working on the OpenGL driver and have a create function that is called after the window is created which gets all the screen resolutions and sets up the pixel format and all the other stuff needed. This works fine.
I also have a destruction which is called on destroy.
Now the problem I have is that I need to be able to go fullscreen or back to a window at will. I have tried to put calls to ChangeWindowSettingsEx() with CDS_FULLSCREEN (or 0) to do that, but it doesn’t work.
Is there a way of either doing this without having to destroy the window and then recreate it? Or can I safely use DirectDraw to do the fullscreen/window change?
When I include the code to do the mode change it puts me into a window (the 0 parameter) that is 800x600x16 - which is not correct, I actually want a window on the desktop.
But, then when I try to go fullscreen, it tries, then gives me a window with my scene in, but the scene is not animated anymore and the objects are white. It should also be fullscreen and it isn’t - although the window controls aren’t there anymore.
This is strange, any ideas as to how I can achieve this?
Luke A. Guest.