Browse Source

ADDED: UploadMesh() #1529

Upload mesh data to GPU and get VAO/VBO identifiers
pull/1544/head
Ray 4 years ago
parent
commit
f4f208c4ae
2 changed files with 7 additions and 0 deletions
  1. +6
    -0
      src/models.c
  2. +1
    -0
      src/raylib.h

+ 6
- 0
src/models.c View File

@ -849,6 +849,12 @@ Mesh *LoadMeshes(const char *fileName, int *meshCount)
return meshes;
}
// Upload mesh vertex data to GPU
void UploadMesh(Mesh *mesh)
{
rlLoadMesh(&mesh, false); // Static mesh by default
}
// Unload mesh from memory (RAM and/or VRAM)
void UnloadMesh(Mesh mesh)
{

+ 1
- 0
src/raylib.h View File

@ -1339,6 +1339,7 @@ RLAPI void UnloadModelKeepMeshes(Model model);
// Mesh loading/unloading functions
RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file
RLAPI void UploadMesh(Mesh *mesh); // Upload mesh vertex data to GPU (VRAM)
RLAPI void UnloadMesh(Mesh mesh); // Unload mesh from memory (RAM and/or VRAM)
RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success

Loading…
Cancel
Save