diff --git a/src/Quad.hpp b/src/Quad.hpp index 01600c1..b83968e 100644 --- a/src/Quad.hpp +++ b/src/Quad.hpp @@ -11,9 +11,9 @@ class Quad : public Primitive { //positions colors texture coordinates -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, 1.0f, //bottom left - 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f, //bottom right - 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, //top right - -0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 1.0f //top left + 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f, //bottom right + 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, //top right + -0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 1.0f //top left }; this->unindexedVertexCount = 6; this->dataCount = 44; @@ -26,31 +26,15 @@ class Quad : public Primitive { this->indicesSize = 6 * sizeof(unsigned int); } else { - /*this->data = new float[132] { - - //positions colors texture coordinates - -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, //bottom left - 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, //bottom right - 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, //top right - -0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, //top left - -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, 0.0f, //bottom left - 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 0.0f, //bottom right - 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, //top right - -0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, //top left - -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, //bottom left - 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, //bottom right - 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, //top right - -0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f //top left - };*/ this->data = new float[66] { //positions colors texture coordinates - -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, 1.0f, //bottom left - 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f, //bottom right - 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, //top right - 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, //top right - -0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 1.0f, //top left - -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, 1.0f, //bottom left + -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, 1.0f, //bottom left + 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f, //bottom right + 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, //top right + 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, //top right + -0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, 1.0f, //top left + -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, 1.0f, //bottom left }; this->unindexedVertexCount = 6; this->dataCount = 66; diff --git a/src/VertexBuffer.cpp b/src/VertexBuffer.cpp index 97b95b2..ffcaad1 100644 --- a/src/VertexBuffer.cpp +++ b/src/VertexBuffer.cpp @@ -69,7 +69,9 @@ VertexBuffer::VertexBuffer(std::vector vertices, std::vectorindexBuffer; + if (this->indexBuffer != nullptr) { + delete this->indexBuffer; + } } void VertexBuffer::bind() { glBindBuffer(GL_ARRAY_BUFFER, this->vboID); diff --git a/x64/Release/LazarOpe.3ad642ad.tlog/CL.command.1.tlog b/x64/Release/LazarOpe.3ad642ad.tlog/CL.command.1.tlog index 6aa353c..f9266d0 100644 Binary files a/x64/Release/LazarOpe.3ad642ad.tlog/CL.command.1.tlog and b/x64/Release/LazarOpe.3ad642ad.tlog/CL.command.1.tlog differ diff --git a/x64/Release/LazarOpe.3ad642ad.tlog/CL.read.1.tlog b/x64/Release/LazarOpe.3ad642ad.tlog/CL.read.1.tlog index 291a77d..bb97e23 100644 Binary files a/x64/Release/LazarOpe.3ad642ad.tlog/CL.read.1.tlog and b/x64/Release/LazarOpe.3ad642ad.tlog/CL.read.1.tlog differ diff --git a/x64/Release/LazarOpe.3ad642ad.tlog/CL.write.1.tlog b/x64/Release/LazarOpe.3ad642ad.tlog/CL.write.1.tlog index ed9bc79..f3b379c 100644 Binary files a/x64/Release/LazarOpe.3ad642ad.tlog/CL.write.1.tlog and b/x64/Release/LazarOpe.3ad642ad.tlog/CL.write.1.tlog differ diff --git a/x64/Release/LazarOpenGLEngine3D.exe b/x64/Release/LazarOpenGLEngine3D.exe index d136164..f4659c1 100644 Binary files a/x64/Release/LazarOpenGLEngine3D.exe and b/x64/Release/LazarOpenGLEngine3D.exe differ