Add loading screen
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
#include "VertexArray.h"
|
||||
#include "defines.h"
|
||||
@@ -46,3 +47,20 @@ void VertexArray::unbind()
|
||||
{
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
||||
std::vector<Vertex> VertexArray::createVertices(float *vertices, uint32_t numVertices, float *textureCoordinates) {
|
||||
std::vector<Vertex> vertexVec;
|
||||
uint32_t i = 0;
|
||||
uint32_t k = 0;
|
||||
for(; i < numVertices; i+=3) {
|
||||
Vertex currentVertex = {};
|
||||
currentVertex.position.x = vertices[i];
|
||||
currentVertex.position.y = vertices[i+1];
|
||||
currentVertex.position.z = vertices[i+2];
|
||||
currentVertex.textureCoords.x = textureCoordinates[k];
|
||||
currentVertex.textureCoords.y = textureCoordinates[k+1];
|
||||
k+=2;
|
||||
vertexVec.push_back(currentVertex);
|
||||
}
|
||||
return vertexVec;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user