/* trdemo.c */ /* * Test/demonstration of tile rendering utility library. * See tr.h for more info. * * Brian Paul * April 1997 */ #include #include #include "GL/glut.h" #include "tr.h" #define TILESIZE 100 #define NUMBALLS 30 static GLfloat BallPos[NUMBALLS][3]; static GLfloat BallSize[NUMBALLS]; static GLfloat BallColor[NUMBALLS][4]; static GLboolean Perspective = GL_TRUE; static int WindowWidth, WindowHeight; /* Return random float in [0,1] */ static float Random(void) { int i = rand(); return (float) (i % 1000) / 1000.0; } /* Draw my stuff */ static void DrawScene(void) { int i; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); for (i=0;i