This is the last time we let Gabe commit ascii porn in the comments.

This commit is contained in:
Eri - 2016-01-06 03:14:26 +01:00
parent 1f7b2b82b8
commit 68b04bf9a3
1 changed files with 10 additions and 7 deletions

View File

@ -35,7 +35,7 @@ float xrot_scene = 0.0f;
float yrot_scene = 0.0f; float yrot_scene = 0.0f;
float zrot_scene = 0.0f; float zrot_scene = 0.0f;
float i = 0.3; float i = 0.5;
int full = 0; int full = 0;
int oszi = 0; int oszi = 0;
@ -152,14 +152,14 @@ void LoadGLTextures() {
// Create Texture // Create Texture
glGenTextures(1, &texture[0]); 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_MAG_FILTER,GL_NEAREST); // 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_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, // 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. // border 0 (normal), rgb color data (24bit), 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); 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. */ /* 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. // swap buffers to display, since we're double buffered.
glutSwapBuffers(); glutSwapBuffers();
if (oszi) rotate(1); if (oszi) rotate(1);
glutTimerFunc(5, &DrawGLScene, 0);
} }
/* The function called whenever a key is pressed. */ /* The function called whenever a key is pressed. */
@ -354,7 +356,7 @@ int main(int argc, char **argv)
/*glutFullScreen();*/ /*glutFullScreen();*/
/* Even if there are no events, redraw our gl scene. */ /* Even if there are no events, redraw our gl scene. */
glutIdleFunc(&DrawGLScene); /* glutIdleFunc(&DrawGLScene); */
/* Register the function called when our window is resized. */ /* Register the function called when our window is resized. */
glutReshapeFunc(&ReSizeGLScene); glutReshapeFunc(&ReSizeGLScene);
@ -367,6 +369,7 @@ int main(int argc, char **argv)
/* Initialize our window. */ /* Initialize our window. */
InitGL(640, 480); InitGL(640, 480);
glutTimerFunc(5, &DrawGLScene, 0);
/* Start Event Processing Engine */ /* Start Event Processing Engine */
glutMainLoop(); glutMainLoop();