libsdl-org / sdlwiki

This is the raw contents of SDL's wiki. You can edit this through GitHub or at https://wiki.libsdl.org/ now!
https://wiki.libsdl.org/
83 stars 41 forks source link

Feedback on page SDL2/SDL_RenderSetVSync #459

Open iloveclang opened 9 months ago

iloveclang commented 9 months ago

It would be nice if there was some kind of explanation how to check if Vsync has actually been set

because, looking at the code, it appears that the function can only fail if the renderer check fails, or the int vsync argument is anything other than 0 or 1.

There appears to be no feedback on whether the vsync actually succeeded.

Is one supposed to check if (renderer->wanted_vsync || renderer->simulate_vsync ) ?

icculus commented 6 months ago

@slouken, is the vsync results checkable on SDL2? (and SDL3?)

slouken commented 6 months ago

No, it's guaranteed to work except on OpenGL, and if it fails in that case we'll simulate vsync, so it always succeeds from the perspective of the application.