Hello,
I've got a problem with my screen update. I had a few sprites moving around in a windowed 1024, 768 environment and everything was going well. In the code, I clear the screen, tell the code to draw the sprites in their respective places in the backbuffer and then I flip the screen; so far, so what, but when I took my code into work to test it on another machine, the frame rate looked really low and laggy. However my framerate display shows it's running at a consistent 75 frames per seocnd; the same as back home.
Now we use two monitors in work; back home I have recently installed a second monitor and guess what? The lag has started to appear here too.
Something wierd is going on with the screen refresh, it seems to be out of sync with my game. Could it be related to the dual monitor setup? Even if I turn the monitor off it still lags. If it is a monitor problem, how can I sync up the refresh to the game so that it runs fine?
I'm quite new to coding, but if I take out the 'Flip' function from my code, shouldn't this stop anything appearing in the window? Because when I take it out, the game still shows the sprites on the screen, but they flash on badly and tear down the screen as if they were being drawn straight onto the screen and not the backbuffer; is that right? I've set it up so that the back buffer is the buffer used, but it looks like something is overriding when the buffer gets drawn to the screen,
Sorry for the mumbling, I'll try and explain better if you need me to. Any ideas?
Cheers
I've got a problem with my screen update. I had a few sprites moving around in a windowed 1024, 768 environment and everything was going well. In the code, I clear the screen, tell the code to draw the sprites in their respective places in the backbuffer and then I flip the screen; so far, so what, but when I took my code into work to test it on another machine, the frame rate looked really low and laggy. However my framerate display shows it's running at a consistent 75 frames per seocnd; the same as back home.
Now we use two monitors in work; back home I have recently installed a second monitor and guess what? The lag has started to appear here too.
Something wierd is going on with the screen refresh, it seems to be out of sync with my game. Could it be related to the dual monitor setup? Even if I turn the monitor off it still lags. If it is a monitor problem, how can I sync up the refresh to the game so that it runs fine?
I'm quite new to coding, but if I take out the 'Flip' function from my code, shouldn't this stop anything appearing in the window? Because when I take it out, the game still shows the sprites on the screen, but they flash on badly and tear down the screen as if they were being drawn straight onto the screen and not the backbuffer; is that right? I've set it up so that the back buffer is the buffer used, but it looks like something is overriding when the buffer gets drawn to the screen,
Sorry for the mumbling, I'll try and explain better if you need me to. Any ideas?
Cheers