transparent-cube

Minimal cross-platform native/wasm graphics example.
git clone git://git.amin.space/transparent-cube.git
Log | Files | Refs | README | LICENSE

commit 5ba65bf7abac4f84677c3edf3acda7868f5831e4
parent 9f0b201485bef9194e718b13c524f6e99e14f45d
Author: amin <dev@aminmesbah.com>
Date:   Sun, 23 Jun 2019 19:51:52 +0000

Fix gl viewport update

FossilOrigin-Name: d363738cbf77ebb9e165b91ec114e5d37a929078b00e985db32b82849fc42bcc
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)