summaryrefslogtreecommitdiff
path: root/_wasm/intro
diff options
context:
space:
mode:
authorMatthew Kosarek <mattkae@protonmail.com>2021-10-31 13:54:11 -0400
committerMatthew Kosarek <mattkae@protonmail.com>2021-10-31 13:54:11 -0400
commit5c613a10364f30bd6add25f7950433f0c482c3ca (patch)
treeaf8f6e481b6400329eca12bd8cdb35e0237d63af /_wasm/intro
parenta214b4f8977a4b115710b5c9d152b392ac8e24f7 (diff)
(mkosarek) Working undamped spring motion
Diffstat (limited to '_wasm/intro')
-rw-r--r--_wasm/intro/intro.cpp10
1 files changed, 5 insertions, 5 deletions
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);