Some demo stuff
This commit is contained in:
@@ -27,9 +27,9 @@ Texture Texture::FromFile(const char *filename) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
int nrChannels;
|
||||
unsigned char* data = stbi_load(filename, &tex.width, &tex.height, &nrChannels, 0);
|
||||
unsigned char* data = stbi_load(filename, &tex.width, &tex.height, &nrChannels, 4);
|
||||
if (data) {
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tex.width, tex.height, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.width, tex.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
} else {
|
||||
Util::Die("Error loading texture file: ", filename);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "Screen.h"
|
||||
|
||||
const Vertex vertices[] = {
|
||||
Vertex(-1.0f, -1.0f, 0.0f, 0.0f, 0.0f),
|
||||
Vertex(-1.0f, 1.0f, 0.0f, 0.0f, 1.0f),
|
||||
Vertex(-1.0f, -1.0f, 0.0f, 0.0f, 0.0f),
|
||||
Vertex(1.0f, -1.0f, 0.0f, 1.0f, 0.0f),
|
||||
|
||||
|
||||
Vertex(-1.0f, 1.0f, 0.0f, 0.0f, 1.0f),
|
||||
Vertex(1.0f, -1.0f, 0.0f, 1.0f, 0.0f),
|
||||
Vertex(1.0f, 1.0f, 0.0f, 1.0f, 1.0f)
|
||||
|
||||
@@ -85,6 +85,9 @@ int main() {
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_BACK);
|
||||
|
||||
root = Node::GetRoot();
|
||||
|
||||
Input *input = Input::GetInstance();
|
||||
|
||||
Reference in New Issue
Block a user