Added acVertexBufferSet in the utils interface

This commit is contained in:
jpekkila
2020-08-24 14:29:01 +03:00
parent ed875b1e7e
commit 94794cee91
2 changed files with 13 additions and 3 deletions

View File

@@ -44,6 +44,9 @@ typedef struct {
/** Loads data from the config file */
AcResult acLoadConfig(const char* config_path, AcMeshInfo* config);
/** */
AcResult acVertexBufferSet(const VertexBufferHandle handle, const AcReal value, AcMesh* mesh);
/** */
AcResult acMeshSet(const AcReal value, AcMesh* mesh);

View File

@@ -21,12 +21,19 @@
#include "errchk.h"
AcResult
acMeshSet(const AcReal value, AcMesh* mesh)
acVertexBufferSet(const VertexBufferHandle handle, const AcReal value, AcMesh* mesh)
{
const int n = acVertexBufferSize(mesh->info);
for (int i = 0; i < n; ++i)
mesh->vertex_buffer[handle][i] = value;
return AC_SUCCESS;
}
AcResult
acMeshSet(const AcReal value, AcMesh* mesh)
{
for (int w = 0; w < NUM_VTXBUF_HANDLES; ++w)
for (int i = 0; i < n; ++i)
mesh->vertex_buffer[w][i] = value;
acVertexBufferSet(w, value, mesh);
return AC_SUCCESS;
}