redraw as fast as possible
This commit is contained in:
parent
dca7d5a8b8
commit
c2c36d4be4
@ -120,16 +120,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
display(window);
|
||||
SDL_Event event;
|
||||
while (SDL_WaitEvent(&event))
|
||||
bool exit = false;
|
||||
for (;;)
|
||||
{
|
||||
if (event.type == SDL_QUIT)
|
||||
break;
|
||||
else if (event.type == SDL_KEYDOWN)
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
if (event.key.keysym.sym == SDLK_ESCAPE)
|
||||
break;
|
||||
if (event.key.keysym.sym == SDLK_RETURN)
|
||||
display(window);
|
||||
if (event.type == SDL_QUIT)
|
||||
exit = true;
|
||||
else if (event.type == SDL_KEYDOWN)
|
||||
{
|
||||
if (event.key.keysym.sym == SDLK_ESCAPE)
|
||||
exit = true;
|
||||
}
|
||||
}
|
||||
if (exit)
|
||||
break;
|
||||
display(window);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user