(*edit* - in hindsight, this probably should be in the 'bugs' forum... )
I was playing around with the graphics mode refreshrate parameters so a game I'm working on can work at the same speed regardless of the actual refresh rate, and ran into something odd:
From what I understand, when you select a 'non-supported' refresh rate, from BlitzMax is supposed to pick a near match and apply some frame limiting to 'fit' your screen updates in there. (OpenGL bglSetSwapInterval, I presume)
Overall this seems to work pretty well, but I did notice a very odd one in there:
- If I specify 60Hz, my FPS counter returns 60FPS for me, and the GetGraphics command also returns 60.
- If I specify 54Hz, both FPS and GetGraphics counter return 54.
- If I specify 56Hz, both FPs and GetGraphics counter return 56.
- However, the 55Hz mode behaved quite differently from the others:
If I first run at 60Hz, stop the program, change the value over to 55Hz, and run again, things go a bit weird: Now things appear to move around faster than they should. FPS counter shows 60 instead of 55, but the GetGraphics command correctly returns '55'.
I'm using the refreshrate as returned by GetGraphics to calculate the speed of some objects, so the fact that they move too fast clearly indicates that the frame limiting isn't happening like it should.
Now, even weirder:
- If I go first to 60Hz (=correct) and then to 55Hz, the 55Hz mode does not do the proper frame limiting.
- If I go first to 60Hz (=correct), then to 54Hz (=correct), and then switch to 55Hz, there is no proper frame limiting.
- Howver, If I go first to 60Hz (=correct), then to 56Hz (=correct), and then switch to 55Hz, then it is correctly limiting itself to 55FPS.
Very weird -- could this be some openGL context variable not getting reset properly or something?
While this example above is obviously not something any real program would do, it does show that there may be circumstances under which the frame limiting isn't working as it should...
(Aside from this example changing back and forth between various screenmodes/refreshrates by a game, what would happen if you jump straight into 55Hz mode on a computer that defaults to 60Hz on a certain screenmode? Could this issue also appear then? That could potentially be a bit more of a 'real-world' issue I suppose)
(I have a feeling that we'll be seeing frame limiting be used to smooth out gameplay to some extend on slower machines, which aren't always able to render OpenGL fast enough to run smooth without the frame limiting.
I was playing around with the graphics mode refreshrate parameters so a game I'm working on can work at the same speed regardless of the actual refresh rate, and ran into something odd:
From what I understand, when you select a 'non-supported' refresh rate, from BlitzMax is supposed to pick a near match and apply some frame limiting to 'fit' your screen updates in there. (OpenGL bglSetSwapInterval, I presume)
Overall this seems to work pretty well, but I did notice a very odd one in there:
- If I specify 60Hz, my FPS counter returns 60FPS for me, and the GetGraphics command also returns 60.
- If I specify 54Hz, both FPS and GetGraphics counter return 54.
- If I specify 56Hz, both FPs and GetGraphics counter return 56.
- However, the 55Hz mode behaved quite differently from the others:
If I first run at 60Hz, stop the program, change the value over to 55Hz, and run again, things go a bit weird: Now things appear to move around faster than they should. FPS counter shows 60 instead of 55, but the GetGraphics command correctly returns '55'.
I'm using the refreshrate as returned by GetGraphics to calculate the speed of some objects, so the fact that they move too fast clearly indicates that the frame limiting isn't happening like it should.
Now, even weirder:
- If I go first to 60Hz (=correct) and then to 55Hz, the 55Hz mode does not do the proper frame limiting.
- If I go first to 60Hz (=correct), then to 54Hz (=correct), and then switch to 55Hz, there is no proper frame limiting.
- Howver, If I go first to 60Hz (=correct), then to 56Hz (=correct), and then switch to 55Hz, then it is correctly limiting itself to 55FPS.
Very weird -- could this be some openGL context variable not getting reset properly or something?
While this example above is obviously not something any real program would do, it does show that there may be circumstances under which the frame limiting isn't working as it should...
(Aside from this example changing back and forth between various screenmodes/refreshrates by a game, what would happen if you jump straight into 55Hz mode on a computer that defaults to 60Hz on a certain screenmode? Could this issue also appear then? That could potentially be a bit more of a 'real-world' issue I suppose)
(I have a feeling that we'll be seeing frame limiting be used to smooth out gameplay to some extend on slower machines, which aren't always able to render OpenGL fast enough to run smooth without the frame limiting.