you can now print images on the screen
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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
|
||||
};
|
||||
Reference in New Issue
Block a user