-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vsync python #820
Comments
@lordloki, @youle31: Currently To avoid this situation I suggest to let in RAS_ICanvas a value of the current set Vsync mode (from an enum). The setter will set the vsync mode AND the swap interval value whereas getter will just read the vsync mode and not care about swap interval. What do you think ? |
hi, I don't really know what is swap interval but if there is a possibility to display a warning when "adaptative vsync" is not supported, it can be useful i guess too. Else, to be honest, i'm not familiar with vsync... |
Previously bge.render.getVsync wasn't returning the value set by setVsync when VSYNC_ADAPTIVE was used. It can be justified by the fact that adaptive is set by using a negative swap interval value but the GLX get function still returns a positive swap interval value and the flag GLX_LATE_SWAPS_TEAR_EXT meaning adaptive is enabled. In any case GLX could refuse a swap interval and the user should be able to do setVsync(getVsync()) with no change on the swap control. To achieve this behaviour RAS_ICanvas store the current swap control in a enum variable m_controlSwap, this variable is used in getter GetSwapControl used by bge.render.getVsync(). The setter is virtual and overloaded in each canvas implementation, they use a common table to find the swap interval associated to the swap control mode: RAS_ICanvas::swapInterval. Finally KX_PythonInit is using swap control enum value from RAS_ICanvas instead of the one from DNA to avoid conversions. Fix issue #820.
Previously bge.render.getVsync wasn't returning the value set by setVsync when VSYNC_ADAPTIVE was used. It can be justified by the fact that adaptive is set by using a negative swap interval value but the GLX get function still returns a positive swap interval value and the flag GLX_LATE_SWAPS_TEAR_EXT meaning adaptive is enabled. In any case GLX could refuse a swap interval and the user should be able to do setVsync(getVsync()) with no change on the swap control. To achieve this behaviour RAS_ICanvas store the current swap control in a enum variable m_controlSwap, this variable is used in getter GetSwapControl used by bge.render.getVsync(). The setter is virtual and overloaded in each canvas implementation, they use a common table to find the swap interval associated to the swap control mode: RAS_ICanvas::swapInterval. Finally KX_PythonInit is using swap control enum value from RAS_ICanvas instead of the one from DNA to avoid conversions. Fix issue #820.
Previously bge.render.getVsync wasn't returning the value set by setVsync when VSYNC_ADAPTIVE was used. It can be justified by the fact that adaptive is set by using a negative swap interval value but the GLX get function still returns a positive swap interval value and the flag GLX_LATE_SWAPS_TEAR_EXT meaning adaptive is enabled. In any case GLX could refuse a swap interval and the user should be able to do setVsync(getVsync()) with no change on the swap control. To achieve this behaviour RAS_ICanvas store the current swap control in a enum variable m_controlSwap, this variable is used in getter GetSwapControl used by bge.render.getVsync(). The setter is virtual and overloaded in each canvas implementation, they use a common table to find the swap interval associated to the swap control mode: RAS_ICanvas::swapInterval. Finally KX_PythonInit is using swap control enum value from RAS_ICanvas instead of the one from DNA to avoid conversions. Fix issue #820.
i dont really know if it is bug or its intentional but:
bge.render.setVsync(bge.render.VSYNC_ON)
bge.render.getVsync()
returns 1
bge.render.setVsync(bge.render.VSYNC_OFF)
bge.render.getVsync()
returns 0
bge.render.setVsync(bge.render.VSYNC_ADAPTIVE)
bge.render.getVsync()
returns 0 as vsyncoff
upbge 0.2.3
The text was updated successfully, but these errors were encountered: