mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Animated vertex renaming
This commit is contained in:
20
src/rlgl.h
20
src/rlgl.h
@ -205,8 +205,8 @@ typedef unsigned char byte;
|
|||||||
unsigned short *indices;// vertex indices (in case vertex data comes indexed)
|
unsigned short *indices;// vertex indices (in case vertex data comes indexed)
|
||||||
|
|
||||||
// Animation vertex data
|
// Animation vertex data
|
||||||
float *baseVertices; // Vertex base position (required to apply bones transformations)
|
float *animVertices; // Animated vertex positions (after bones transformations)
|
||||||
float *baseNormals; // Vertex base normals (required to apply bones transformations)
|
float *animNormals; // Animated normals (after bones transformations)
|
||||||
float *weightBias; // Vertex weight bias
|
float *weightBias; // Vertex weight bias
|
||||||
int *weightId; // Vertex weight id
|
int *weightId; // Vertex weight id
|
||||||
|
|
||||||
@ -455,6 +455,7 @@ void rlDeleteVertexArrays(unsigned int id); // Unload vertex data (V
|
|||||||
void rlDeleteBuffers(unsigned int id); // Unload vertex data (VBO) from GPU memory
|
void rlDeleteBuffers(unsigned int id); // Unload vertex data (VBO) from GPU memory
|
||||||
void rlClearColor(byte r, byte g, byte b, byte a); // Clear color buffer with color
|
void rlClearColor(byte r, byte g, byte b, byte a); // Clear color buffer with color
|
||||||
void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth)
|
void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth)
|
||||||
|
void rlUpdateBuffer(int bufferId, void *data, int dataSize); // Update GPU buffer with new data
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Functions Declaration - rlgl functionality
|
// Functions Declaration - rlgl functionality
|
||||||
@ -1501,6 +1502,13 @@ void rlClearScreenBuffers(void)
|
|||||||
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // Stencil buffer not used...
|
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // Stencil buffer not used...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update GPU buffer with new data
|
||||||
|
void rlUpdateBuffer(int bufferId, void *data, int dataSize)
|
||||||
|
{
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, bufferId);
|
||||||
|
glBufferSubData(GL_ARRAY_BUFFER, 0, dataSize, data);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Module Functions Definition - rlgl Functions
|
// Module Functions Definition - rlgl Functions
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -2788,10 +2796,10 @@ void rlUnloadMesh(Mesh *mesh)
|
|||||||
free(mesh->texcoords2);
|
free(mesh->texcoords2);
|
||||||
free(mesh->indices);
|
free(mesh->indices);
|
||||||
|
|
||||||
free(mesh->baseVertices);
|
free(mesh->animVertices);
|
||||||
free(mesh->baseNormals);
|
free(mesh->animNormals);
|
||||||
free(mesh->weightBias);
|
free(mesh->boneWeights);
|
||||||
free(mesh->weightId);
|
free(mesh->boneIds);
|
||||||
|
|
||||||
rlDeleteBuffers(mesh->vboId[0]); // vertex
|
rlDeleteBuffers(mesh->vboId[0]); // vertex
|
||||||
rlDeleteBuffers(mesh->vboId[1]); // texcoords
|
rlDeleteBuffers(mesh->vboId[1]); // texcoords
|
||||||
|
|||||||
Reference in New Issue
Block a user