Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9022d90

Browse files
committed
README-emscripten: corrected comments about vsync.
1 parentef0a604 commit9022d90

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

‎docs/README-emscripten.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,15 @@ Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
210210
present anything on the screen until your return from your mainloop
211211
function.
212212

213-
Note that on other platforms, SDL will default to vsync_off_ in the 2D render
214-
API. Since changing this will affect how the mainloop runs, the 2D render API
215-
will only change vsync settings if explicitly requested by the app, either
216-
with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER, or calling
217-
SDL_SetRenderVSync(). Otherwise it will default to whatever the Emscripten
218-
mainloop is set to use via emscripten_set_main_loop().
213+
Note that SDL attempts to default to vsync_off_ on all platforms. You almost
214+
certainly do_not_ want this in Emscripten, however, as it will affect the
215+
efficiency of the mainloop. If using OpenGL directly, you should call
216+
SDL_GL_SetSwapInterval(1) sometime near startup; if using the 2D render API,
217+
either create the renderer with with the property
218+
SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER set to 1, or call
219+
SDL_SetRenderVSync(renderer, 1). If you don't explicitly set vsync, you'll get
220+
a higher (but perhaps unstable) framerate, and use more power, but it will
221+
still work. Choosing a vsync of 1 will use requestAnimationFrame if possible.
219222

220223
If you're using the SDL main callbacks, the mainloop defaults to using
221224
requestAnimationFrame (effectively vsync), because it calls

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp