Clean up project

This commit is contained in:
Caesar2011
2016-09-06 08:20:12 +02:00
parent b1c6dcfecb
commit 364ed31d8e
4 changed files with 63 additions and 69 deletions

View File

@@ -170,7 +170,6 @@ int main(int argc, char* args[]) {
GLFWwindow* window;
GLuint tex_jpe;
int textw, texth;
int timer = 0;
/* Initialize the library */
@@ -181,10 +180,11 @@ int main(int argc, char* args[]) {
return 1;
}
/* Create a windowed mode window and its OpenGL context */
glfwSetWindowSizeLimits(window, 640, 480, 640, 480);
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window) {
glfwTerminate();
return -1;
return 1;
}
/* Make the window's context current */
glfwMakeContextCurrent(window);
@@ -247,16 +247,16 @@ int main(int argc, char* args[]) {
tex_jpe=LoadTexture("../img/tests/test.png",&textw,&texth);
tex_jpe = LoadTexture("../img/tests/test.png",&textw,&texth);
glfwSetWindowSize (window, textw, texth);
glViewport(0, 0, textw, texth);
glfwSetWindowSizeLimits(window, textw, texth, textw, texth);
GLuint programID = LoadShaders("trimap.vertexshader", "trimap.fragmentshader");
GLint textureLocation = glGetUniformLocation(programID, "myTextureSampler");
GLint widthLocation = glGetUniformLocation(programID, "pixWidth");
GLint heigthLocation = glGetUniformLocation(programID, "pixHeight");
printf("Shader program ID: %d\n", programID);
printf("textureLocation: %d\n", textureLocation);
printf("widthLocation: %d\n", widthLocation);
@@ -269,9 +269,6 @@ int main(int argc, char* args[]) {
// INIT END
/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window)) {
timer += 1;
if (timer==800)
timer = 0;
/* Render here */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);