Created
January 24, 2012 09:23
-
-
Save hermansc/1669227 to your computer and use it in GitHub Desktop.
Revisions
-
hermansc created this gist
Jan 24, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ int SIZE = 1; bool UP; void Render() { // Clean up the colour of the window and the depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); // Set random colour on resize orange glColor3f(GenerateRandomColor(), GenerateRandomColor(), GenerateRandomColor()); // Draw a built-in primitive // If the mutex UP is true we add 1 to the size, and if it is false we subtract. // The range goes from 1 to 20. if (SIZE == 20){ UP = false; } if (SIZE == 1){ UP = true; } if (UP) {SIZE += 1;} else { SIZE -= 1; } glutSolidTeapot(SIZE); // All drawing commands applied to the hidden buffer, so now, bring forward // the hidden buffer and hide the visible one glutSwapBuffers(); }