forked from Green-Sky/tomato
sdl (master post 3.1 preview) Merge commit 'e4f454091a943345938608570b104400f62fd625'
This commit is contained in:
14
external/sdl/SDL/test/checkkeys.c
vendored
14
external/sdl/SDL/test/checkkeys.c
vendored
@@ -15,14 +15,14 @@
|
||||
pump the event loop and catch keystrokes.
|
||||
*/
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
#include <SDL3/SDL_test.h>
|
||||
|
||||
#ifdef SDL_PLATFORM_EMSCRIPTEN
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
|
||||
static SDLTest_CommonState *state;
|
||||
static SDLTest_TextWindow *textwin;
|
||||
static int done;
|
||||
@@ -228,7 +228,7 @@ static void loop(void)
|
||||
/* Slow down framerate */
|
||||
SDL_Delay(100);
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#ifdef SDL_PLATFORM_EMSCRIPTEN
|
||||
if (done) {
|
||||
emscripten_cancel_main_loop();
|
||||
}
|
||||
@@ -266,7 +266,7 @@ int main(int argc, char *argv[])
|
||||
SDL_GetWindowSize(state->windows[0], &w, &h);
|
||||
textwin = SDLTest_TextWindowCreate(0.f, 0.f, (float)w, (float)h);
|
||||
|
||||
#ifdef __IOS__
|
||||
#ifdef SDL_PLATFORM_IOS
|
||||
{
|
||||
int i;
|
||||
/* Creating the context creates the view, which we need to show keyboard */
|
||||
@@ -285,7 +285,7 @@ int main(int argc, char *argv[])
|
||||
/* Watch keystrokes */
|
||||
done = 0;
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#ifdef SDL_PLATFORM_EMSCRIPTEN
|
||||
emscripten_set_main_loop(loop, 0, 1);
|
||||
#else
|
||||
while (!done) {
|
||||
|
||||
Reference in New Issue
Block a user