1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
void RePaint ()
{
glClear (GL_COLOR_BUFFER_BIT);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
gluLookAt (0,0,-10,0,0,0,0,1,0);
glBegin(GL_QUADS);
glColor3d(1,1,1);
glTexCoord2i(1,0);glVertex2f(3.6,3.6);
glTexCoord2i(1,1);glVertex2f(3.6,4);
glTexCoord2i(0,1);glVertex2f(4,4);
glTexCoord2i(0,0);glVertex2f(4,3.6);
glEnd();
glBegin (GL_QUADS);
glColor3d (0,0,1);
glVertex2f (5.3,3);
glVertex2f (5.3,2.7);
glVertex2f (-5.3,2.7);
glVertex2f (-5.3,3);
glEnd ();
glBegin (GL_QUADS);
glColor3d (0,0,1);
glVertex2f (5.3,-4);
glVertex2f (5.3,-3.9);
glVertex2f (-5.3,-3.9);
glVertex2f (-5.3,-4);
glEnd ();
glBegin (GL_QUADS);
glColor3d (1,1,1);
glVertex2f (5,y1);
glVertex2f (5,y1+1.5);
glVertex2f (5.3,y1+1.5);
glVertex2f (5.3,y1);
glEnd ();
glBegin (GL_QUADS);
glColor3d (1,1,1);
glVertex2f (-5,y2);
glVertex2f (-5,y2+1.5);
glVertex2f (-5.3,y2+1.5);
glVertex2f (-5.3,y2);
glEnd ();
glBegin (GL_QUADS);
glColor3d (1,0,0);
glVertex2f (balle_x+0.1,balle_y-0.1);
glVertex2f (balle_x+0.1,balle_y+0.1);
glVertex2f (balle_x-0.1,balle_y+0.1);
glVertex2f (balle_x-0.1,balle_y-0.1);
glEnd ();
SwapBuffers (DC);
} |
Partager