Closed orange451 closed 2 years ago
In fact the timer concept is quite confusing. createTimer() also seems to have the effect of applying the timer to the object containing the method. I think that's a pretty confusing API design for a public-facing API.
To keep in the spirit of JavaFX, perhaps make the public facing api use a two-way bind variable to control refresh rate (DoubleProperty)? If you decide to go with it, maybe the public facing api could be: OpenGLCanvas#desiredFPSProperty(): DoubleProperty As well as OpenGLCanvas#getDesiredFPS() OpenGLCanvas#setDesiredFPS(double fps)
Yes, the Timer was created "just to be". In the future, I want to fully remake it.
I redesigned the Timer class. Now it’s called Animator. See the readme for details
The method name and input param seem to conflict with each-other. Normally when creating timers you specify the time in between each iteration. Whereas this is specifying the desired FPS.
Might I suggest renaming this method to OpenGLCanvas#setDesiredRefreshRate()
Also is there a way to unlimit the fps? No documentation that I can find currently (I don't think many of the methods have documentation)