early-access version 2281
This commit is contained in:
16
externals/SDL/test/checkkeysthreads.c
vendored
16
externals/SDL/test/checkkeysthreads.c
vendored
@@ -86,6 +86,8 @@ print_modifiers(char **text, size_t *maxlen)
|
||||
print_string(text, maxlen, " CAPS");
|
||||
if (mod & KMOD_MODE)
|
||||
print_string(text, maxlen, " MODE");
|
||||
if (mod & KMOD_SCROLL)
|
||||
print_string(text, maxlen, " SCROLL");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -136,9 +138,10 @@ PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat)
|
||||
}
|
||||
|
||||
static void
|
||||
PrintText(char *eventtype, char *text)
|
||||
PrintText(const char *eventtype, const char *text)
|
||||
{
|
||||
char *spot, expanded[1024];
|
||||
const char *spot;
|
||||
char expanded[1024];
|
||||
|
||||
expanded[0] = '\0';
|
||||
for ( spot = text; *spot; ++spot )
|
||||
@@ -207,7 +210,7 @@ static int SDLCALL ping_thread(void *ptr)
|
||||
{
|
||||
int cnt;
|
||||
SDL_Event sdlevent;
|
||||
memset(&sdlevent, 0 , sizeof(SDL_Event));
|
||||
SDL_memset(&sdlevent, 0 , sizeof(SDL_Event));
|
||||
for (cnt = 0; cnt < 10; ++cnt) {
|
||||
fprintf(stderr, "sending event (%d/%d) from thread.\n", cnt + 1, 10); fflush(stderr);
|
||||
sdlevent.type = SDL_KEYDOWN;
|
||||
@@ -222,6 +225,7 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
SDL_Window *window;
|
||||
SDL_Renderer *renderer;
|
||||
SDL_Thread *thread;
|
||||
|
||||
/* Enable standard application logging */
|
||||
@@ -243,6 +247,12 @@ main(int argc, char *argv[])
|
||||
quit(2);
|
||||
}
|
||||
|
||||
/* On wayland, no window will actually show until something has
|
||||
actually been displayed.
|
||||
*/
|
||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
#if __IPHONEOS__
|
||||
/* Creating the context creates the view, which we need to show keyboard */
|
||||
SDL_GL_CreateContext(window);
|
||||
|
Reference in New Issue
Block a user