Shader first pass

This commit is contained in:
2026-03-17 08:42:43 -05:00
parent 7356286fe0
commit ff92a78dda
24 changed files with 634 additions and 87 deletions

View File

@@ -6,7 +6,8 @@
*/
#include "display/mesh/mesh.h"
#include "assert/assert.h"
#include "assert/assertgl.h"
#include "error/errorgl.h"
errorret_t meshInitGL(
meshgl_t *mesh,
@@ -33,26 +34,27 @@ errorret_t meshDrawGL(
// PSP style pointer legacy OpenGL
const GLsizei stride = sizeof(meshvertex_t);
glColorPointer(
sizeof(color4b_t),
GL_UNSIGNED_BYTE,
stride,
(const GLvoid*)&mesh->vertices[offset].color
);
glTexCoordPointer(
MESH_VERTEX_UV_SIZE,
GL_FLOAT,
stride,
(const GLvoid*)&mesh->vertices[offset].uv
);
glVertexPointer(
MESH_VERTEX_POS_SIZE,
GL_FLOAT,
stride,
(const GLvoid*)&mesh->vertices[offset].pos
);
// glColorPointer(
// sizeof(color4b_t),
// GL_UNSIGNED_BYTE,
// stride,
// (const GLvoid*)&mesh->vertices[offset].color
// );
// glTexCoordPointer(
// MESH_VERTEX_UV_SIZE,
// GL_FLOAT,
// stride,
// (const GLvoid*)&mesh->vertices[offset].uv
// );
// glVertexPointer(
// MESH_VERTEX_POS_SIZE,
// GL_FLOAT,
// stride,
// (const GLvoid*)&mesh->vertices[offset].pos
// );
glDrawArrays(mesh->primitiveType, offset, count);
// glDrawArrays(mesh->primitiveType, offset, count);
// errorChain(errorGLCheck());
errorOk();
}