transparent-cube

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

commit 9fd697f486d2948239832e5056377946c2e510c3
parent 4268464c78aa655b36928a7e5cb03b426bd103e5
Author: amin <dev@aminmesbah.com>
Date:   Fri, 21 Jun 2019 06:19:29 +0000

Don't truncate float color values

LOL

FossilOrigin-Name: d516107ea1cbcefdd1e14a98f6e71f945796338c3bacd7d6f95a94364aaf60c6
Diffstat:
Msrc/platform_wasm.c | 2+-
Msrc/webgl.h | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/platform_wasm.c b/src/platform_wasm.c @@ -27,7 +27,7 @@ export bool init(void) export void render(void) { time += 16; - game_update_and_render(&g_game_state, time, g_width, g_height); + game_update_and_render(&g_game_state, time/1000.0f, 800, 600); } export void window_resize(int w, int h) diff --git a/src/webgl.h b/src/webgl.h @@ -121,7 +121,7 @@ inline void glClear(GLbitfield mask) inline void glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { - webglClearColor(WEBGL_CAST_I32(red), WEBGL_CAST_I32(green), WEBGL_CAST_I32(blue), WEBGL_CAST_I32(alpha)); + webglClearColor((f32)red, (f32)green, (f32)blue, (f32)alpha); } inline void glCompileShader(GLuint shader)