From 5c613a10364f30bd6add25f7950433f0c482c3ca Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Sun, 31 Oct 2021 13:54:11 -0400 Subject: (mkosarek) Working undamped spring motion --- _wasm/intro/intro.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '_wasm') diff --git a/_wasm/intro/intro.cpp b/_wasm/intro/intro.cpp index 8e1574b..3146eaf 100644 --- a/_wasm/intro/intro.cpp +++ b/_wasm/intro/intro.cpp @@ -44,14 +44,14 @@ struct OrthographicProgramData { } uniformVariables; }; -struct OrthographicVertex { +struct Vertex2d { Vector2 position; Vector4 color; }; // Create a triangle struct TriangleObject { - OrthographicVertex vertices[3]; + Vertex2d vertices[3]; Vector2 velocity; Vector2 position; GLuint mVao; @@ -66,13 +66,13 @@ struct TriangleObject { glGenBuffers(1, &mVbo); glBindBuffer(GL_ARRAY_BUFFER, mVbo); - glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(OrthographicVertex), &vertices[0], GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(Vertex2d), &vertices[0], GL_STATIC_DRAW); glEnableVertexAttribArray(programData->attributes.position); - glVertexAttribPointer(programData->attributes.position, 2, GL_FLOAT, GL_FALSE, sizeof(OrthographicVertex), (GLvoid *)0); + glVertexAttribPointer(programData->attributes.position, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex2d), (GLvoid *)0); glEnableVertexAttribArray(programData->attributes.color); - glVertexAttribPointer(programData->attributes.color, 4, GL_FLOAT, GL_FALSE, sizeof(OrthographicVertex), (GLvoid *)offsetof(OrthographicVertex, color)); + glVertexAttribPointer(programData->attributes.color, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex2d), (GLvoid *)offsetof(Vertex2d, color)); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); -- cgit v1.2.1