Deferred showing window until after the first frame has rendered

Fixes #97
This commit is contained in:
rxi
2020-05-14 23:06:14 +01:00
parent b8d2805502
commit 5102088aca
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdbool.h>
#include <assert.h>
#include <math.h>
#include "lib/stb/stb_truetype.h"
@@ -65,6 +66,11 @@ void ren_init(SDL_Window *win) {
void ren_update_rects(RenRect *rects, int count) {
SDL_UpdateWindowSurfaceRects(window, (SDL_Rect*) rects, count);
static bool initial_frame = true;
if (initial_frame) {
SDL_ShowWindow(window);
initial_frame = false;
}
}