fix texture rendering
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
#include <GL/gl.h>
|
||||
|
||||
Texture::Texture() {
|
||||
mTexturehandle = bmploader().loadBMP("../block.bmp");
|
||||
mTexturehandle = bmploader().loadBMP("../assets/blocks/block.bmp");
|
||||
}
|
||||
|
||||
void Texture::Bind() {
|
||||
|
@ -13,13 +13,15 @@ VertexArray::VertexArray(const VertexBuffer& buff) {
|
||||
buff.Bind();
|
||||
|
||||
// generate new vertex array object
|
||||
glGenVertexArrays(2, &handle);
|
||||
glGenVertexArrays(1, &handle);
|
||||
|
||||
Bind();
|
||||
|
||||
// specify syntax of my data
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(float), (void *) nullptr);
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(float), (void *) nullptr);
|
||||
glEnableVertexAttribArray(0);
|
||||
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(float), (void *) 12);
|
||||
glEnableVertexAttribArray(1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user