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.
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.
“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.
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.
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.