transparent-cube

Minimal cross-platform native/wasm graphics example.
Log | Files | Refs | README | LICENSE

commit 373c75b33657b03d9eb96b576ec7177fa2a1218c
parent 7f9aead11126e2b3d7badbaa3eb3f702acb0aa84
Author: Amin Mesbah <dev@aminmesbah.com>
Date:   Sun, 23 Jun 2019 12:51:52 -0700

Fix gl viewport update

Diffstat:
Msrc/game.c | 1-
Msrc/platform_wasm.c | 1+
2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/game.c b/src/game.c @@ -121,7 +121,6 @@ void game_init(struct GameState *game_state, u32 screen_width, u32 screen_height void game_update_and_render(struct GameState *game_state, float dt, u32 screen_width, u32 screen_height) { - glViewport(0, 0, screen_width, screen_height); #if 1 { glClearColor(0.1f, 0.1f, 0.1f, 1.0f); diff --git a/src/platform_wasm.c b/src/platform_wasm.c @@ -34,6 +34,7 @@ export void window_resize(int w, int h) { g_width = w; g_height = h; + glViewport(0, 0, g_width, g_height); } i32 str_length(const char *str)