Commit d3ea15e544e1203e23b8ebe91e6ee04eb84220ad

Thomas de Grivel 2024-01-14T21:29:08

wip OpenGL 3.3

diff --git a/libc3/window/sdl2/gl_object.c b/libc3/window/sdl2/gl_object.c
index 9e47615..a4cd746 100644
--- a/libc3/window/sdl2/gl_object.c
+++ b/libc3/window/sdl2/gl_object.c
@@ -111,18 +111,18 @@ bool gl_object_update (s_gl_object *object)
   glBufferData(GL_ARRAY_BUFFER, object->vertex.count * sizeof(s_gl_vertex),
                object->vertex.data, GL_STATIC_DRAW);
   assert(glGetError() == GL_NO_ERROR);
-  glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, sizeof(s_gl_vertex),
+  glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(s_gl_vertex),
                         (void *) 0);
   assert(glGetError() == GL_NO_ERROR);
   glEnableVertexAttribArray(0);
   assert(glGetError() == GL_NO_ERROR);
-  glVertexAttribPointer(1, 3, GL_DOUBLE, GL_FALSE, sizeof(s_gl_vertex),
-                        (void *) (3 * sizeof(double)));
+  glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(s_gl_vertex),
+                        (void *) (3 * sizeof(float)));
   assert(glGetError() == GL_NO_ERROR);
   glEnableVertexAttribArray(1);
   assert(glGetError() == GL_NO_ERROR);
-  glVertexAttribPointer(2, 2, GL_DOUBLE, GL_FALSE, sizeof(s_gl_vertex),
-                        (void *) (6 * sizeof(double)));
+  glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, sizeof(s_gl_vertex),
+                        (void *) (6 * sizeof(float)));
   assert(glGetError() == GL_NO_ERROR);
   glEnableVertexAttribArray(2);
   assert(glGetError() == GL_NO_ERROR);
diff --git a/libc3/window/sdl2/types.h b/libc3/window/sdl2/types.h
index 85f9e11..44bf5f9 100644
--- a/libc3/window/sdl2/types.h
+++ b/libc3/window/sdl2/types.h
@@ -93,8 +93,8 @@ struct gl_font {
 
 struct gl_lines {
   s_array vertex;
-  u32 gl_vao;
-  u32 gl_vbo;
+  GLuint gl_vao;
+  GLuint gl_vbo;
 };
 
 struct gl_matrix_3d {
@@ -200,9 +200,9 @@ struct gl_text {
 };
 
 struct gl_triangle {
-  u32 a;
-  u32 b;
-  u32 c;
+  GLuint a;
+  GLuint b;
+  GLuint c;
 };
 
 struct rgb {