Initial commit

This commit is contained in:
plane000
2018-09-16 14:02:14 +01:00
parent a3b712b6b7
commit 32d9ad1dea
11 changed files with 443 additions and 4 deletions

33
OpenGL/main.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <iostream>
#include <GL/glew.h>
#include "display.h"
#include "mesh.h"
#include "shader.h"
#undef main
int main(int argc, char** argv) {
Display display(800, 600, "Crumpet Engine");
glClearColor(0.1f, 0.45f, 0.9f, 1.0f);
GLfloat vertices[] = {
-0.5f, -0.5f, 0.0f,
0.5f, -0.5f, 0.0f,
0.0f, 0.5f, 0.0f
};
Mesh mesh(vertices, sizeof(vertices) / sizeof(vertices[0]));
Shader shader;
while(!display.isClosed()) {
glClear(GL_COLOR_BUFFER_BIT);
shader.Bind();
mesh.Draw();
display.Update();
}
return 0;
}