update to newer glcxx library with Texture support
This commit is contained in:
1 parent
78d3eca026
commit
9e7c523b48
3 files changed
+6
-5
No files matched your search
@@ -4,6 +4,7 @@ OBJS += glcxx/src/glcxx/Array.o
|
||||
OBJS += glcxx/src/glcxx/Buffer.o
|
||||
OBJS += glcxx/src/glcxx/Program.o
|
||||
OBJS += glcxx/src/glcxx/Shader.o
|
||||
OBJS += glcxx/src/glcxx/Texture.o
|
||||
REPOS := glcxx glm
|
||||
|
||||
CCFLAGS := $(shell sdl2-config --cflags)
|
||||
|
||||
@@ -22,7 +22,7 @@ static struct
|
||||
} uniforms;
|
||||
glm::mat4 modelview;
|
||||
glm::mat4 projection;
|
||||
GLuint texture;
|
||||
std::shared_ptr<glcxx::Texture> texture;
|
||||
GLubyte texture_data[16][16][4];
|
||||
|
||||
#define WIDTH 800
|
||||
@@ -58,7 +58,7 @@ bool init(void)
|
||||
1, -1, 1, 0, 0, 1, 1, 0,
|
||||
1, 1, 1, 0, 0, 1, 1, 1,
|
||||
-1, 1, 1, 0, 0, 1, 0, 1});
|
||||
cube_array = make_shared<glcxx::Array>();
|
||||
cube_array = glcxx::Array::create();
|
||||
cube_array->bind();
|
||||
cube_buffer->bind();
|
||||
glEnableVertexAttribArray(0);
|
||||
@@ -91,9 +91,9 @@ bool init(void)
|
||||
}
|
||||
}
|
||||
|
||||
glGenTextures(1, &texture);
|
||||
texture = glcxx::Texture::create();
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
texture->bind(GL_TEXTURE_2D);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, &texture_data[0][0][0]);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
+1
-1
Submodule glcxx updated: e0f6651161...dfb199cc8d.
Reference in new issue
Block a user