mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-08 04:20:14 -05:00
Document and clean up trienglesoup.
This commit is contained in:
@@ -49,7 +49,6 @@ TriangleSoup::~TriangleSoup() {
|
||||
glDeleteVertexArrays(1, &_vaoID);
|
||||
}
|
||||
|
||||
|
||||
void TriangleSoup::setVertexPositions(std::vector<glm::vec4> positions) {
|
||||
_useVertexPositions = true;
|
||||
_gpuDataNeedUpdate = true;
|
||||
@@ -63,7 +62,6 @@ void TriangleSoup::setVertexPositions(std::vector<glm::vec4> positions) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TriangleSoup::setVertexTextureCoordinates(std::vector<glm::vec2> textures) {
|
||||
_useTextureCoordinates = true;
|
||||
_gpuDataNeedUpdate = true;
|
||||
@@ -75,7 +73,6 @@ void TriangleSoup::setVertexTextureCoordinates(std::vector<glm::vec2> textures)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TriangleSoup::setVertexNormals(std::vector<glm::vec3> normals) {
|
||||
_useVertexNormals = true;
|
||||
_gpuDataNeedUpdate = true;
|
||||
@@ -88,7 +85,6 @@ void TriangleSoup::setVertexNormals(std::vector<glm::vec3> normals) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TriangleSoup::setElements(std::vector<unsigned int> elements) {
|
||||
_elementData.resize(elements.size());
|
||||
_gpuDataNeedUpdate = true;
|
||||
@@ -98,7 +94,7 @@ void TriangleSoup::setElements(std::vector<unsigned int> elements) {
|
||||
}
|
||||
}
|
||||
|
||||
bool TriangleSoup::updateDataInGPU() {
|
||||
bool TriangleSoup::updateDataOnGPU() {
|
||||
// Create VAO
|
||||
if (_vaoID == 0)
|
||||
glGenVertexArrays(1, &_vaoID);
|
||||
@@ -119,7 +115,6 @@ bool TriangleSoup::updateDataInGPU() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// First VAO setup
|
||||
glBindVertexArray(_vaoID);
|
||||
|
||||
@@ -167,7 +162,7 @@ bool TriangleSoup::updateDataInGPU() {
|
||||
|
||||
void TriangleSoup::drawUsingActiveProgram() {
|
||||
if (_gpuDataNeedUpdate) {
|
||||
updateDataInGPU();
|
||||
updateDataOnGPU();
|
||||
}
|
||||
glBindVertexArray(_vaoID);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _elementBufferID);
|
||||
|
||||
Reference in New Issue
Block a user