you can now print images on the screen

This commit is contained in:
2026-04-16 00:29:05 +02:00
parent 291f774a95
commit 952c5062bc
7 changed files with 7523 additions and 9 deletions

View File

@@ -15,9 +15,12 @@ struct VertexBuffer {
// POSITION
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*) offsetof(Vertex,x));
// COLOR
// TEXTURE COORDINATES
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*) offsetof(Vertex,r));
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*) offsetof(Vertex,u));
// COLOR
glEnableVertexAttribArray(2);
glVertexAttribPointer(2, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (void*) offsetof(Vertex,r));
glBindVertexArray(0);
};

View File

@@ -16,5 +16,6 @@ typedef double float64;
struct Vertex {
float32 x, y, z; // position
float32 u, v; // texture coordinates
float32 r, g, b, a; // color
};