MCPcopy Create free account
hub / github.com/defold/defold / Sys_SetVsyncSwapInterval

Function Sys_SetVsyncSwapInterval

engine/script/src/script_sys.cpp:1341–1355  ·  view source on GitHub ↗

set vsync swap interval * Set the vsync swap interval. The interval with which to swap the front and back buffers * in sync with vertical blanks (v-blank), the hardware event where the screen image is updated * with data from the front buffer. A value of 1 swaps the buffers at every v-blank, a value of * 2 swaps the buffers every other v-blank and so on. A value of 0 disables waiti

Source from the content-addressed store, hash-verified

1339 * ```
1340 */
1341 static int Sys_SetVsyncSwapInterval(lua_State* L)
1342 {
1343 DM_LUA_STACK_CHECK(L, 0);
1344
1345 dmSystemDDF::SetVsync msg;
1346 msg.m_SwapInterval = luaL_checkinteger(L, 1);
1347
1348 dmMessage::URL url;
1349 GetSystemURL(&url);
1350
1351 dmMessage::Result result = dmMessage::Post(0, &url, dmSystemDDF::SetVsync::m_DDFDescriptor->m_NameHash, 0, (uintptr_t) dmSystemDDF::SetVsync::m_DDFDescriptor, &msg, sizeof(msg), 0);
1352 assert(result == dmMessage::RESULT_OK);
1353
1354 return 0;
1355 }
1356
1357 /*# set update frequency
1358 * Set game update-frequency (frame cap). This option is equivalent to `display.update_frequency` in

Callers

nothing calls this directly

Calls 4

luaL_checkintegerFunction · 0.85
GetSystemURLFunction · 0.85
PostFunction · 0.50
assertFunction · 0.50

Tested by

no test coverage detected