README-emscripten: corrected comments about vsync.
This commit is contained in:
@@ -210,12 +210,15 @@ Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
|
|||||||
present anything on the screen until your return from your mainloop
|
present anything on the screen until your return from your mainloop
|
||||||
function.
|
function.
|
||||||
|
|
||||||
Note that on other platforms, SDL will default to vsync _off_ in the 2D render
|
Note that SDL attempts to default to vsync _off_ on all platforms. You almost
|
||||||
API. Since changing this will affect how the mainloop runs, the 2D render API
|
certainly do _not_ want this in Emscripten, however, as it will affect the
|
||||||
will only change vsync settings if explicitly requested by the app, either
|
efficiency of the mainloop. If using OpenGL directly, you should call
|
||||||
with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER, or calling
|
SDL_GL_SetSwapInterval(1) sometime near startup; if using the 2D render API,
|
||||||
SDL_SetRenderVSync(). Otherwise it will default to whatever the Emscripten
|
either create the renderer with with the property
|
||||||
mainloop is set to use via emscripten_set_main_loop().
|
SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER set to 1, or call
|
||||||
|
SDL_SetRenderVSync(renderer, 1). If you don't explicitly set vsync, you'll get
|
||||||
|
a higher (but perhaps unstable) framerate, and use more power, but it will
|
||||||
|
still work. Choosing a vsync of 1 will use requestAnimationFrame if possible.
|
||||||
|
|
||||||
If you're using the SDL main callbacks, the mainloop defaults to using
|
If you're using the SDL main callbacks, the mainloop defaults to using
|
||||||
requestAnimationFrame (effectively vsync), because it calls
|
requestAnimationFrame (effectively vsync), because it calls
|
||||||
|
|||||||
Reference in New Issue
Block a user