improve pollevent

This commit is contained in:
KikooDX 2022-03-12 22:11:00 +01:00
parent aac891a977
commit d04324372d
1 changed files with 5 additions and 7 deletions

View File

@ -403,7 +403,7 @@ int LZY_PollEvent(LZY_Event *e) {
e->u.key.scancode = gk_e.key;
return 1;
default:
return -1;
break;
}
}
}
@ -895,7 +895,7 @@ int LZY_SoundPlay(LZY_Sound *sound, int loops) {
int LZY_PollEvent(LZY_Event *e) {
SDL_Event sdl_e;
if (SDL_PollEvent(&sdl_e) != 0) {
while (SDL_PollEvent(&sdl_e) != 0) {
switch (sdl_e.type) {
case SDL_QUIT:
e->type = LZY_QUIT;
@ -923,8 +923,7 @@ int LZY_PollEvent(LZY_Event *e) {
!fullscreen);
}
}
return -1;
}
} break;
case SDL_KEYUP: {
int i = LZYK_COUNT;
while (i-- > 0) {
@ -935,10 +934,9 @@ int LZY_PollEvent(LZY_Event *e) {
return 1;
}
}
return -1;
}
} break;
default:
return -1;
break;
}
}