From 68b04bf9a3f3a8f0b4fd295c29d331839790a964 Mon Sep 17 00:00:00 2001 From: eri451 Date: Wed, 6 Jan 2016 03:14:26 +0100 Subject: [PATCH] This is the last time we let Gabe commit ascii porn in the comments. --- animation.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/animation.c b/animation.c index eddf45b..ad6f097 100755 --- a/animation.c +++ b/animation.c @@ -35,7 +35,7 @@ float xrot_scene = 0.0f; float yrot_scene = 0.0f; float zrot_scene = 0.0f; -float i = 0.3; +float i = 0.5; int full = 0; int oszi = 0; @@ -152,14 +152,14 @@ void LoadGLTextures() { // Create Texture glGenTextures(1, &texture[0]); - glBindTexture(GL_TEXTURE_2D, texture[0]); // 2d texture (x and y size) - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // scale linearly when image bigger than texture - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // scale linearly when image smalled than texture + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); // scale linearly when image bigger than texture + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); // scale linearly when image smalled than texture // 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image, - // border 0 (normal), rgb color data, unsigned byte data, and finally the data itself. - glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->sizeX, image1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->data); + // border 0 (normal), rgb color data (24bit), unsigned byte data, and finally the data itself. + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, image1->sizeX, image1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->data); + glBindTexture(GL_TEXTURE_2D, texture[0]); // 2d texture (x and y size) }; /* A general OpenGL initialization function. Sets all of the initial parameters. */ @@ -259,6 +259,8 @@ void DrawGLScene() // swap buffers to display, since we're double buffered. glutSwapBuffers(); if (oszi) rotate(1); + + glutTimerFunc(5, &DrawGLScene, 0); } /* The function called whenever a key is pressed. */ @@ -354,7 +356,7 @@ int main(int argc, char **argv) /*glutFullScreen();*/ /* Even if there are no events, redraw our gl scene. */ - glutIdleFunc(&DrawGLScene); + /* glutIdleFunc(&DrawGLScene); */ /* Register the function called when our window is resized. */ glutReshapeFunc(&ReSizeGLScene); @@ -367,6 +369,7 @@ int main(int argc, char **argv) /* Initialize our window. */ InitGL(640, 480); + glutTimerFunc(5, &DrawGLScene, 0); /* Start Event Processing Engine */ glutMainLoop();