GLvoid InitGL(GLvoid) { int i; glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // This Will Clear The Background Color To Black glClearDepth(1.0); // Enables Clearing Of The Depth Buffer glDepthFunc(GL_LESS); // The Type Of Depth Test To Do glEnable(GL_DEPTH_TEST); // Enables Depth Testing glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Reset The Projection Matrix gluPerspective(45.0f, (GLfloat)kWindowWidth/(GLfloat)kWindowHeight,0.1f,100.0f); // Calculate The Aspect Ratio Of The Window glMatrixMode(GL_MODELVIEW); for (i=0; i<N; i++) { mr[i].r = rect_open(); rect_init(mr[i].r, RECT5whxyz ,drand()/5.0+0.1,drand()/5.0+0.1, drand(),drand(),drand()); rect_setcolor(mr[i].r, drand(), drand(), drand()); mr[i].dx=drand()/10; mr[i].dy=mr[i].dx; } /*for*/ }
void dbox (iImage * dest, int x, int y, int end_x, int end_y, int r, int g, int b) { int r2, g2, b2; r2 = r + 100; g2 = g + 100; b2 = b + 100; if (r2 > 255) r2 = 255; if (g2 > 255) g2 = 255; if (b2 > 255) b2 = 255; rect (dest, x + 4, y + 4, end_x - 4, end_y - 4, r2, g2, b2); r2 = r + 75; g2 = g + 75; b2 = b + 75; if (r2 > 255) r2 = 255; if (g2 > 255) g2 = 255; if (b2 > 255) b2 = 255; rect_open (dest, x + 3, y + 3, end_x - 3, end_y - 3, r2, g2, b2); r2 = r + 50; g2 = g + 50; b2 = b + 50; if (r2 > 255) r2 = 255; if (g2 > 255) g2 = 255; if (b2 > 255) b2 = 255; rect_open (dest, x + 2, y + 2, end_x - 2, end_y - 2, r2, g2, b2); r2 = r + 25; g2 = g + 25; b2 = b + 25; if (r2 > 255) r2 = 255; if (g2 > 255) g2 = 255; if (b2 > 255) b2 = 255; rect_open (dest, x + 1, y + 1, end_x - 1, end_y - 1, r2, g2, b2); rect_open (dest, x, y, end_x, end_y, r, g, b); }