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/
79 stars 32 forks source link

Feedback on page SDL3/SDL_SetRenderVSync #533

Closed Susko3 closed 3 months ago

Susko3 commented 3 months ago

https://wiki.libsdl.org/SDL3/SDL_SetRenderVSync

the vertical refresh sync interval, 1 to synchronize present with every vertical refresh, 2 to synchronize present with every second vertical refresh, etc., or -1 for late swap tearing (adaptive vsync). Not every value is supported by every renderer, so you should check the return value to see whether the requested setting is supported.

Does passing in 0 disable vsync?

Susko3 commented 3 months ago

It would probably make sense to have -1 and 0 defined as special values. SDL_VYSNC_DISABLE, SDL_VSYNC_ADAPTIVE or similar.

SDL_SetRenderVSync(renderer, -1); // unclear what this function does without looking into the docs
// compare with:
SDL_SetRenderVSync(renderer, SDL_VSYNC_ADAPTIVE);
slouken commented 3 months ago

It would probably make sense to have -1 and 0 defined as special values. SDL_VYSNC_DISABLE, SDL_VSYNC_ADAPTIVE or similar.

SDL_SetRenderVSync(renderer, -1); // unclear what this function does without looking into the docs
// compare with:
SDL_SetRenderVSync(renderer, SDL_VSYNC_ADAPTIVE);

Yes, that sounds good. Want to make a PR adding these defines below the function?