More code moving

This commit is contained in:
2026-03-07 12:09:40 -06:00
parent dd048d9b0d
commit 71e6079054
22 changed files with 261 additions and 291 deletions

View File

@@ -0,0 +1,66 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "error/error.h"
#include "display/mesh/meshvertex.h"
typedef enum {
MESH_PRIMITIVE_TYPE_TRIANGLES = GL_TRIANGLES,
MESH_PRIMITIVE_TYPE_LINES = GL_LINES,
MESH_PRIMITIVE_TYPE_POINTS = GL_POINTS,
} meshprimitivetypegl_t;
typedef struct {
} meshgl_t;
/**
* Initializes a mesh for OpenGL.
*
* @param mesh The mesh to initialize.
* @param primitiveType The OpenGL primitive type (e.g., GL_TRIANGLES).
* @param vertexCount The number of vertices in the mesh.
* @param vertices The vertex data for the mesh.
* @return An errorret_t indicating success or failure.
*/
errorret_t meshInitGL(
meshgl_t *mesh,
const meshprimitivetypegl_t primitiveType,
const int32_t vertexCount,
const meshvertex_t *vertices
);
/**
* Draws a mesh using OpenGL.
*
* @param mesh The mesh to draw.
* @param vertexOffset The offset in the vertex array to start drawing from.
* @param vertexCount The number of vertices to draw. If -1, draws all vertices.
* @return An errorret_t indicating success or failure.
*/
errorret_t meshDrawGL(
const meshgl_t *mesh,
const int32_t vertexOffset,
const int32_t vertexCount
);
/**
* Gets the vertex count of a mesh used for OpenGL.
*
* @param mesh The mesh to get the vertex count from.
* @return The vertex count of the mesh.
*/
int32_t meshGetVertexCountGL(const meshgl_t *mesh);
/**
* Disposes a mesh used for OpenGL.
*
* @param mesh The mesh to dispose.
* @return An errorret_t indicating success or failure.
*/
errorret_t meshDisposeGL(meshgl_t *mesh);