From 2e0dd1ab5a755bbb92c350e0c16e61b22cb7e763 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Fri, 14 Jan 2022 09:12:18 -0500 Subject: [PATCH] move getMeshData function to internal --- src/shader.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/shader.cpp b/src/shader.cpp index a17f754..d12ceba 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -29,6 +29,7 @@ bool compileAndLinkShader(shader_program* shader, u32 getGLTypeSize(GLenum e); GLTexture* getFreeGLTexture(GLContext* gl_ctx); bool loadGLTexture(util_image* image, GLuint& tex_id); +void* getMeshData(const mesh& m, const GLBufferToAttribMapping& mapping); // NOTE: interface @@ -251,18 +252,6 @@ initGLAttribBuffer(gl_buffer* buf, GLenum target, GLVertexAttrib* attrib) buf->name = utilAllocateCStr(attrib->name); } -void* -getMeshData(const mesh& m, const GLBufferToAttribMapping& mapping) -{ - switch (mapping.buf_type) { - case VERTEX: return m.vertices; - case NORMAL: return m.normals; - case UV: return m.uvs; - case COLOR: return m.colors; - default: return nullptr; - } -} - // FIXME: might as well pass in pointer to GLmesh, since that's how we're // going to use this, can void copying GLmesh twice that way GLmesh @@ -331,6 +320,18 @@ freeGLMesh(GLmesh* glm) // NOTE: internal +void* +getMeshData(const mesh& m, const GLBufferToAttribMapping& mapping) +{ + switch (mapping.buf_type) { + case VERTEX: return m.vertices; + case NORMAL: return m.normals; + case UV: return m.uvs; + case COLOR: return m.colors; + default: return nullptr; + } +} + GLTexture* getFreeGLTexture(GLContext* gl_ctx) {