Skip to content
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 API #2640

Open
ghost opened this issue Apr 24, 2018 · 5 comments
Open

Vsync API #2640

ghost opened this issue Apr 24, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 24, 2018

Will be support for vsync on/off api in the future?

@jaibeer72
Copy link
Contributor

I must ask do you mean like the ability to have the setting to say for example

 new Canvas(size_w,sizw_h,aa=false)

or like in line
being able to inline say

window.aa = false

@ghost
Copy link
Author

ghost commented Nov 7, 2019

I mean as glfwSwapInterval(mode) of GLFW where mode is 0 (Unlimited FPS) or 1 (60 FPS).

@jaibeer72
Copy link
Contributor

Oh ! my bad sounds like way above my paygrade 😅 but I am sure to go through the repo soon enough as I am new to this and see if there is a way to poll the events based on available resources. and see if it's possible

@kainino0x
Copy link
Contributor

The new desynchronized context creation attribute (still in development) can help you achieve lower latency. It's not very precisely specified exactly how it behaves, but right now I think it may be either:

  • front buffer rendering
  • tearing allowed (e.g. DXGI_PRESENT_ALLOW_TEARING)

If you're interested in rendering faster than the display refresh rate, you can technically do this by using setTimeout(..., 0) instead of requestAnimationFrame. In conjunction with desynchronized: true, it might be able to achieve low latency. However, it's recommended to always use requestAnimationFrame. The browser's rendering scheduler should already achieve fairly low latency.

@ghost
Copy link
Author

ghost commented Nov 9, 2019

Thanks a lot guys! It's good news for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants