blob: d90024019e14a8f53195d3f55d73aa0bac5c16fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
https://github.com/Grumbel/sdl-jstest/issues/15
https://github.com/Grumbel/sdl-jstest/commit/62124aa8b9d4c3a8eec5206bf0fc09fade52b326
From 62124aa8b9d4c3a8eec5206bf0fc09fade52b326 Mon Sep 17 00:00:00 2001
From: Ingo Ruhnke <grumbel@gmail.com>
Date: Wed, 12 Jul 2023 17:34:38 +0200
Subject: [PATCH] Fix initial blank screen in sdl-jstest
Screen was left blank due to only getting drawn once a new event
arrived.
Fixes #15
---
src/sdl-jstest.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/sdl-jstest.c b/src/sdl-jstest.c
index 388e84d..bc95024 100644
--- a/src/sdl-jstest.c
+++ b/src/sdl-jstest.c
@@ -192,11 +192,11 @@ int main(int argc, char** argv)
int quit = 0;
SDL_Event event;
+ bool something_new = TRUE;
while(!quit)
{
SDL_Delay(10);
- bool something_new = FALSE;
while (SDL_PollEvent(&event)) {
something_new = TRUE;
switch(event.type)
@@ -302,6 +302,8 @@ int main(int argc, char** argv)
printw("Press Ctrl-c to exit\n");
refresh();
+
+ something_new = FALSE;
}
if ( getch() == 3 ) // Ctrl-c
|