View Full Version : Switching between a window and fullscreen
06-23-2001, 01:33 PM
My program will run either in a window or fullscreen quite happily. However, I can't seem to switch successfully between the two.
I tried killing my window and recreating it with the new settings, and although this worked, I ended up with my objects 'doubling': I had two copies of each object I had made. One set continued properly, and the rest were all in the same position and did not move.
Any ideas? Is there something I've missed?
Do you clear the window before you draws to it?
06-24-2001, 12:02 AM
noo...how? I know no win32 code at all yet..
Check out the nehe.gamedev.net website tutorial, it'll show you how to do it gracefully.
I mean the buffer that OpenGL is rendering to and is displayed in the window. No win32 specific code is needed for doing that.
06-25-2001, 06:15 AM
There's a number of things that could cause that. nvidia_linux was talking about using glClear(), I think. Another thing that could cause that has to do with how you store your objects. If for instance, you store all your objects in a linked list and when you are re-creating the window you re-create those objects and store them in the linked list again and somehow only the new ones get updated positions.
06-25-2001, 06:21 AM
Thanks for the suggestions, I'll look into it.
06-25-2001, 06:34 AM
I tried clearing it - makes no difference. I'm not using linked lists, I'm using simple arrays... I don't see how they could be causing it. I'm stuck http://www.opengl.org/discussion_boards/ubb/frown.gif.
You should not get stuck on something like this. Try different things. Some suggestions:
- Compare your code with the NeHe tutorials
- Does resizing works?
- Clear the buffer each frame
06-26-2001, 01:23 AM
"Clear the buffer each frame" <-- Am doing
"Compare code with the Nehe tutorials" <-- Can find no obvious differences
"Does resizing work?" <-- Yes, but I still have all the extra objects. It is actually rendering them.
06-26-2001, 05:21 AM
If you are clearing the scene then the only reason that the objects would still be showing is if you are telling them to show somewhere. So somewhere you must be making duplicates of your objects and not moving the old copies of them. There is not much anyone can tell you without taking a look at a lot more code.
06-26-2001, 06:34 AM
I can't see how that's happening, although it seems to be the only reasonable explanation. I'm using arrays to hold object information, and a simple for() to go through and show each object. Since it only goes through a set amount of objects each time I'm not sure how it's happening.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.