transparent-cube

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

commit ef4c386e3244ab803a4e9754a663f9ddb03c8412
parent 1b54f1a17a33c3dea23c5b6e33a6d00b251fb7e2
Author: amin <dev@aminmesbah.com>
Date:   Fri,  1 Mar 2024 08:28:37 +0000

Get everything working with clangd

FossilOrigin-Name: 8a61dc5d83b12a936afeabcc21cc8019155d4ef98c2d9e82a46fcd762431f282
Diffstat:
A.clangd | 6++++++
Acompile_flags.txt | 3+++
Msrc/platform_windows.c | 1+
Msrc/webgl.h | 6------
4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/.clangd b/.clangd @@ -0,0 +1,6 @@ +# Workaround for https://github.com/clangd/clangd/issues/1949 + +If: + PathMatch: src/webgl.h +CompileFlags: + Remove: [-include src/game.h] diff --git a/compile_flags.txt b/compile_flags.txt @@ -0,0 +1,3 @@ +--std=c11 +-Ilib +-include src/game.h diff --git a/src/platform_windows.c b/src/platform_windows.c @@ -1,4 +1,5 @@ #include <inttypes.h> +#include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <time.h> diff --git a/src/webgl.h b/src/webgl.h @@ -143,7 +143,6 @@ static GLuint glCreateShader(GLenum type) static void glDeleteBuffers(GLsizei n, const GLuint *buffers) { - assert(n == 1); i32 the_buffer = WEBGL_CAST_I32(buffers[0]); webglDeleteBuffer(the_buffer); } @@ -155,7 +154,6 @@ static void glDeleteShader(GLuint shader) static void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) { - assert(n == 1); i32 the_array = WEBGL_CAST_I32(arrays[0]); webglDeleteVertexArray(the_array); } @@ -187,17 +185,13 @@ static void glEnableVertexAttribArray(GLuint index) static void glGenBuffers(GLsizei n, GLuint *buffers) { - assert(n == 1); i32 buffer_id = webglCreateBuffer(); - assert(buffer_id >= 0); *buffers = (GLuint)buffer_id; } static void glGenVertexArrays(GLsizei n, GLuint *arrays) { - assert(n == 1); i32 vao_id = webglCreateVertexArray(); - assert(vao_id >= 0); *arrays = (GLuint)vao_id; }