浏览代码

Merge pull request #5041 from PanicTitan/master

[example][web] Fix core_custom_frame_control.c to properly register inputs on web platform
pull/5050/head
Ray 2 个月前
committed by GitHub
父节点
当前提交
78a06990c7
找不到此签名对应的密钥 GPG 密钥 ID: B5690EEEBB952194
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      examples/core/core_custom_frame_control.c

+ 7
- 1
examples/core/core_custom_frame_control.c 查看文件

@ -61,7 +61,9 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
#ifndef PLATFORM_WEB // NOTE: On non web platforms the PollInputEvents just works before the inputs checks
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
#endif
if (IsKeyPressed(KEY_SPACE)) pause = !pause;
@ -76,6 +78,10 @@ int main(void)
if (position >= GetScreenWidth()) position = 0;
timeCounter += deltaTime; // We count time (seconds)
}
#ifdef PLATFORM_WEB // NOTE: On web platform for some reason the PollInputEvents only works after the inputs check, so just call it after check all your inputs (on web)
PollInputEvents(); // Poll input events (SUPPORT_CUSTOM_FRAME_CONTROL)
#endif
//----------------------------------------------------------------------------------
// Draw

正在加载...
取消
保存