PDA

View Full Version : How to Determination position to calculator ?



Haytham
01-17-2016, 07:02 AM
Hello, I would to ask
how to determination position from calculator to
e.g.: in press from mouse in zero print in screen zero.. click in plus(+) print + .etc.

can you help me?

-note: press F2 to turn on the calc.
this is my code:


#include <windows.h>
#include <stdio.h>
#include <GL/glut.h>
#include <GL/gl.h>

static int R_menu, S_menu, menIdMain, C_menu, Draw_Rectangle, Draw_Square;

void myinit()
{
glClearColor(1.0, 1.0, 1.0, 0.0);

gluOrtho2D(0.0, 800.0, 0.0, 800.0);

}
void display(void){
glClear(GL_COLOR_BUFFER_BIT); /* Clear the Window */
glColor3f(0.0, 0.0, 0.0);

//*************
// Border
//*************
glBegin(GL_QUADS);
glVertex2i(80,100);
glVertex2i(590,100);
glVertex2i(590,710);
glVertex2i(80,710);
glEnd();
glFlush();

//*************
// Screen
//*************
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,590);
glVertex2i(580,590);
glVertex2i(580,670);
glVertex2i(90,670);
glEnd();
glFlush();

//*************
// Clear
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,150);
glVertex2i(150,150);
glVertex2i(150,200);
glVertex2i(90,200);
glEnd();
glFlush();


//*************
// ON
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,230);
glVertex2i(150,230);
glVertex2i(150,280);
glVertex2i(90,280);
glEnd();
glFlush();


//*************
// OFF
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,310);
glVertex2i(150,310);
glVertex2i(150,360);
glVertex2i(90,360);
glEnd();
glFlush();

//*************
// Zero
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,150);
glVertex2i(230,150);
glVertex2i(230,200);
glVertex2i(170,200);
glEnd();
glFlush();

//*************
// Dot
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,150);
glVertex2i(310,150);
glVertex2i(310,200);
glVertex2i(250,200);
glEnd();
glFlush();

//*************
// Equal =
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,150);
glVertex2i(430,150);
glVertex2i(430,200);
glVertex2i(330,200);
glEnd();
glFlush();

//*************
// One
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,220);
glVertex2i(230,220);
glVertex2i(230,270);
glVertex2i(170,270);
glEnd();
glFlush();

//*************
// Two
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,220);
glVertex2i(310,220);
glVertex2i(310,270);
glVertex2i(250,270);
glEnd();
glFlush();

//*************
// Three
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,220);
glVertex2i(390,220);
glVertex2i(390,270);
glVertex2i(330,270);
glEnd();
glFlush();

//*************
// Four
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,290);
glVertex2i(230,290);
glVertex2i(230,340);
glVertex2i(170,340);
glEnd();
glFlush();

//*************
// Five
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,290);
glVertex2i(310,290);
glVertex2i(310,340);
glVertex2i(250,340);
glEnd();
glFlush();

//*************
// Six
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,290);
glVertex2i(390,290);
glVertex2i(390,340);
glVertex2i(330,340);
glEnd();
glFlush();

//*************
// Seven
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,360);
glVertex2i(230,360);
glVertex2i(230,410);
glVertex2i(170,410);
glEnd();
glFlush();

//*************
// Eight
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,360);
glVertex2i(310,360);
glVertex2i(310,410);
glVertex2i(250,410);
glEnd();
glFlush();

//*************
// Nine
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,360);
glVertex2i(390,360);
glVertex2i(390,410);
glVertex2i(330,410);
glEnd();
glFlush();

//*************
// Plus +
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,150);
glVertex2i(520,150);
glVertex2i(520,270);
glVertex2i(450,270);
glEnd();
glFlush();

//*************
// Minus -
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,290);
glVertex2i(520,290);
glVertex2i(520,350);
glVertex2i(450,350);
glEnd();
glFlush();

//*************
// Division /
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,370);
glVertex2i(520,370);
glVertex2i(520,430);
glVertex2i(450,430);
glEnd();
glFlush();

//*************
// Multiply *
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,450);
glVertex2i(520,450);
glVertex2i(520,510);
glVertex2i(450,510);
glEnd();
glFlush();

}



//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// Functions
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void GOGO (GLint specialkey, int x, int y)
{
switch(specialkey)
{
case GLUT_KEY_F2:
glClear ( GL_COLOR_BUFFER_BIT ); //clear pixel buffer
glColor3f(0.0, 0.0, 0.0);

//*************
// Border
//*************
glBegin(GL_QUADS);
glVertex2i(80,100);
glVertex2i(590,100);
glVertex2i(590,710);
glVertex2i(80,710);
glEnd();
glFlush();

//*************
// Screen
//*************
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,590);
glVertex2i(580,590);
glVertex2i(580,670);
glVertex2i(90,670);
glEnd();
glFlush();

//*************
// Clear
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,150);
glVertex2i(150,150);
glVertex2i(150,200);
glVertex2i(90,200);
glEnd();
glFlush();


//*************
// ON
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,230);
glVertex2i(150,230);
glVertex2i(150,280);
glVertex2i(90,280);
glEnd();
glFlush();


//*************
// OFF
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,310);
glVertex2i(150,310);
glVertex2i(150,360);
glVertex2i(90,360);
glEnd();
glFlush();

//*************
// Zero
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,150);
glVertex2i(230,150);
glVertex2i(230,200);
glVertex2i(170,200);
glEnd();
glFlush();

//*************
// Dot
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,150);
glVertex2i(310,150);
glVertex2i(310,200);
glVertex2i(250,200);
glEnd();
glFlush();

//*************
// Equal =
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,150);
glVertex2i(430,150);
glVertex2i(430,200);
glVertex2i(330,200);
glEnd();
glFlush();

//*************
// One
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,220);
glVertex2i(230,220);
glVertex2i(230,270);
glVertex2i(170,270);
glEnd();
glFlush();

//*************
// Two
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,220);
glVertex2i(310,220);
glVertex2i(310,270);
glVertex2i(250,270);
glEnd();
glFlush();

//*************
// Three
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,220);
glVertex2i(390,220);
glVertex2i(390,270);
glVertex2i(330,270);
glEnd();
glFlush();

//*************
// Four
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,290);
glVertex2i(230,290);
glVertex2i(230,340);
glVertex2i(170,340);
glEnd();
glFlush();

//*************
// Five
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,290);
glVertex2i(310,290);
glVertex2i(310,340);
glVertex2i(250,340);
glEnd();
glFlush();

//*************
// Six
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,290);
glVertex2i(390,290);
glVertex2i(390,340);
glVertex2i(330,340);
glEnd();
glFlush();

//*************
// Seven
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,360);
glVertex2i(230,360);
glVertex2i(230,410);
glVertex2i(170,410);
glEnd();
glFlush();

//*************
// Eight
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,360);
glVertex2i(310,360);
glVertex2i(310,410);
glVertex2i(250,410);
glEnd();
glFlush();

//*************
// Nine
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,360);
glVertex2i(390,360);
glVertex2i(390,410);
glVertex2i(330,410);
glEnd();
glFlush();

//*************
// Plus +
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,150);
glVertex2i(520,150);
glVertex2i(520,270);
glVertex2i(450,270);
glEnd();
glFlush();

//*************
// Minus -
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,290);
glVertex2i(520,290);
glVertex2i(520,350);
glVertex2i(450,350);
glEnd();
glFlush();

//*************
// Division /
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,370);
glVertex2i(520,370);
glVertex2i(520,430);
glVertex2i(450,430);
glEnd();
glFlush();

//*************
// Multiply *
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,450);
glVertex2i(520,450);
glVertex2i(520,510);
glVertex2i(450,510);
glEnd();
glFlush();
glColor3f(1.0, 1.0, 1.0);

glRasterPos2i(475,470); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '*'); // PRINT LETTER K
glRasterPos2i(475,390); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '/');
glRasterPos2i(475,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '-');
glRasterPos2i(475,200); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '+');
glRasterPos2i(370,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '=');
glRasterPos2i(270,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '.');
glRasterPos2i(200,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '0');
glRasterPos2i(120,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'C');
glRasterPos2i(100,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(120,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'N');
glRasterPos2i(100,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(115,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(125,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(200,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '1');
glRasterPos2i(290,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '2');
glRasterPos2i(360,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '3');
glRasterPos2i(200,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '4');
glRasterPos2i(290,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '5');
glRasterPos2i(360,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '6');
glRasterPos2i(200,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '7');
glRasterPos2i(290,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '8');
glRasterPos2i(360,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '9');
glFlush();

break;
case GLUT_KEY_F1:
glClear ( GL_COLOR_BUFFER_BIT ); //clear pixel buffer
glColor3f(0.0, 0.0, 0.0);

//*************
// Border
//*************
glBegin(GL_QUADS);
glVertex2i(80,100);
glVertex2i(590,100);
glVertex2i(590,710);
glVertex2i(80,710);
glEnd();
glFlush();

//*************
// Screen
//*************
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,590);
glVertex2i(580,590);
glVertex2i(580,670);
glVertex2i(90,670);
glEnd();
glFlush();

//*************
// Clear
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,150);
glVertex2i(150,150);
glVertex2i(150,200);
glVertex2i(90,200);
glEnd();
glFlush();


//*************
// ON
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,230);
glVertex2i(150,230);
glVertex2i(150,280);
glVertex2i(90,280);
glEnd();
glFlush();


//*************
// OFF
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,310);
glVertex2i(150,310);
glVertex2i(150,360);
glVertex2i(90,360);
glEnd();
glFlush();

//*************
// Zero
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,150);
glVertex2i(230,150);
glVertex2i(230,200);
glVertex2i(170,200);
glEnd();
glFlush();

//*************
// Dot
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,150);
glVertex2i(310,150);
glVertex2i(310,200);
glVertex2i(250,200);
glEnd();
glFlush();

//*************
// Equal =
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,150);
glVertex2i(430,150);
glVertex2i(430,200);
glVertex2i(330,200);
glEnd();
glFlush();

//*************
// One
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,220);
glVertex2i(230,220);
glVertex2i(230,270);
glVertex2i(170,270);
glEnd();
glFlush();

//*************
// Two
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,220);
glVertex2i(310,220);
glVertex2i(310,270);
glVertex2i(250,270);
glEnd();
glFlush();

//*************
// Three
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,220);
glVertex2i(390,220);
glVertex2i(390,270);
glVertex2i(330,270);
glEnd();
glFlush();

//*************
// Four
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,290);
glVertex2i(230,290);
glVertex2i(230,340);
glVertex2i(170,340);
glEnd();
glFlush();

//*************
// Five
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,290);
glVertex2i(310,290);
glVertex2i(310,340);
glVertex2i(250,340);
glEnd();
glFlush();

//*************
// Six
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,290);
glVertex2i(390,290);
glVertex2i(390,340);
glVertex2i(330,340);
glEnd();
glFlush();

//*************
// Seven
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,360);
glVertex2i(230,360);
glVertex2i(230,410);
glVertex2i(170,410);
glEnd();
glFlush();

//*************
// Eight
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,360);
glVertex2i(310,360);
glVertex2i(310,410);
glVertex2i(250,410);
glEnd();
glFlush();

//*************
// Nine
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,360);
glVertex2i(390,360);
glVertex2i(390,410);
glVertex2i(330,410);
glEnd();
glFlush();

//*************
// Plus +
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,150);
glVertex2i(520,150);
glVertex2i(520,270);
glVertex2i(450,270);
glEnd();
glFlush();

//*************
// Minus -
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,290);
glVertex2i(520,290);
glVertex2i(520,350);
glVertex2i(450,350);
glEnd();
glFlush();

//*************
// Division /
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,370);
glVertex2i(520,370);
glVertex2i(520,430);
glVertex2i(450,430);
glEnd();
glFlush();

//*************
// Multiply *
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,450);
glVertex2i(520,450);
glVertex2i(520,510);
glVertex2i(450,510);
glEnd();
glFlush();

glColor3f(1.0, 1.0, 1.0);
glRasterPos2i(475,470); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '*'); // PRINT LETTER K
glRasterPos2i(475,390); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '/');
glRasterPos2i(475,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '-');
glRasterPos2i(475,200); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '+');
glRasterPos2i(370,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '=');
glRasterPos2i(270,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '.');
glRasterPos2i(200,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '0');
glRasterPos2i(120,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'C');
glRasterPos2i(100,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'O');
glRasterPos2i(120,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'N');
glRasterPos2i(100,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'O');
glRasterPos2i(115,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'F');
glRasterPos2i(125,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'F');
glRasterPos2i(200,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '1');
glRasterPos2i(290,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '2');
glRasterPos2i(360,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '3');
glRasterPos2i(200,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '4');
glRasterPos2i(290,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '5');
glRasterPos2i(360,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '6');
glRasterPos2i(200,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '7');
glRasterPos2i(290,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '8');
glRasterPos2i(360,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '9');
glFlush();
break;

case GLUT_KEY_F5:
glClear ( GL_COLOR_BUFFER_BIT ); //clear pixel buffer
glColor3f(0.0, 0.0, 0.0);

//*************
// Border
//*************
glBegin(GL_QUADS);
glVertex2i(80,100);
glVertex2i(590,100);
glVertex2i(590,710);
glVertex2i(80,710);
glEnd();
glFlush();

//*************
// Screen
//*************
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,590);
glVertex2i(580,590);
glVertex2i(580,670);
glVertex2i(90,670);
glEnd();
glFlush();

//*************
// Clear
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,150);
glVertex2i(150,150);
glVertex2i(150,200);
glVertex2i(90,200);
glEnd();
glFlush();


//*************
// ON
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,230);
glVertex2i(150,230);
glVertex2i(150,280);
glVertex2i(90,280);
glEnd();
glFlush();


//*************
// OFF
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,310);
glVertex2i(150,310);
glVertex2i(150,360);
glVertex2i(90,360);
glEnd();
glFlush();

//*************
// Zero
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,150);
glVertex2i(230,150);
glVertex2i(230,200);
glVertex2i(170,200);
glEnd();
glFlush();

//*************
// Dot
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,150);
glVertex2i(310,150);
glVertex2i(310,200);
glVertex2i(250,200);
glEnd();
glFlush();

//*************
// Equal =
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,150);
glVertex2i(430,150);
glVertex2i(430,200);
glVertex2i(330,200);
glEnd();
glFlush();

//*************
// One
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,220);
glVertex2i(230,220);
glVertex2i(230,270);
glVertex2i(170,270);
glEnd();
glFlush();

//*************
// Two
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,220);
glVertex2i(310,220);
glVertex2i(310,270);
glVertex2i(250,270);
glEnd();
glFlush();

//*************
// Three
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,220);
glVertex2i(390,220);
glVertex2i(390,270);
glVertex2i(330,270);
glEnd();
glFlush();

//*************
// Four
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,290);
glVertex2i(230,290);
glVertex2i(230,340);
glVertex2i(170,340);
glEnd();
glFlush();

//*************
// Five
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,290);
glVertex2i(310,290);
glVertex2i(310,340);
glVertex2i(250,340);
glEnd();
glFlush();

//*************
// Six
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,290);
glVertex2i(390,290);
glVertex2i(390,340);
glVertex2i(330,340);
glEnd();
glFlush();

//*************
// Seven
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,360);
glVertex2i(230,360);
glVertex2i(230,410);
glVertex2i(170,410);
glEnd();
glFlush();

//*************
// Eight
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,360);
glVertex2i(310,360);
glVertex2i(310,410);
glVertex2i(250,410);
glEnd();
glFlush();

//*************
// Nine
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,360);
glVertex2i(390,360);
glVertex2i(390,410);
glVertex2i(330,410);
glEnd();
glFlush();

//*************
// Plus +
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,150);
glVertex2i(520,150);
glVertex2i(520,270);
glVertex2i(450,270);
glEnd();
glFlush();

//*************
// Minus -
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,290);
glVertex2i(520,290);
glVertex2i(520,350);
glVertex2i(450,350);
glEnd();
glFlush();

//*************
// Division /
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,370);
glVertex2i(520,370);
glVertex2i(520,430);
glVertex2i(450,430);
glEnd();
glFlush();

//*************
// Multiply *
//*************
glColor3f(1.0, 0.0, 0.0);

glBegin(GL_QUADS);
glVertex2i(450,450);
glVertex2i(520,450);
glVertex2i(520,510);
glVertex2i(450,510);
glEnd();
glFlush();

glColor3f(1.0, 1.0, 0.0);
glRasterPos2i(475,470); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '*'); // PRINT LETTER K
glRasterPos2i(475,390); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '/');
glRasterPos2i(475,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '-');
glRasterPos2i(475,200); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '+');
glRasterPos2i(370,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '=');
glRasterPos2i(270,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '.');
glRasterPos2i(200,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '0');
glRasterPos2i(120,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'C');
glRasterPos2i(100,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(120,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'N');
glRasterPos2i(100,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(115,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(125,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(200,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '1');
glRasterPos2i(290,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '2');
glRasterPos2i(360,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '3');
glRasterPos2i(200,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '4');
glRasterPos2i(290,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '5');
glRasterPos2i(360,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '6');
glRasterPos2i(200,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '7');
glRasterPos2i(290,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '8');
glRasterPos2i(360,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '9');
glFlush();
break;

case GLUT_KEY_F12:
exit(0);
break;

}
}


//*****************************
// Menus
//*****************************
void Red_Menu (int C)
{
if (C == 1){

//*****************************
// Change Colour
//*****************************
glClear ( GL_COLOR_BUFFER_BIT ); //clear pixel buffer
glColor3f(0.42, 0.22, 0.10);


//*************
// Border
//*************
glBegin(GL_QUADS);
glVertex2i(80,100);
glVertex2i(590,100);
glVertex2i(590,710);
glVertex2i(80,710);
glEnd();
glFlush();

//*************
// Screen
//*************
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,590);
glVertex2i(580,590);
glVertex2i(580,670);
glVertex2i(90,670);
glEnd();
glFlush();

//*************
// Clear
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,150);
glVertex2i(150,150);
glVertex2i(150,200);
glVertex2i(90,200);
glEnd();
glFlush();


//*************
// ON
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,230);
glVertex2i(150,230);
glVertex2i(150,280);
glVertex2i(90,280);
glEnd();
glFlush();


//*************
// OFF
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(90,310);
glVertex2i(150,310);
glVertex2i(150,360);
glVertex2i(90,360);
glEnd();
glFlush();

//*************
// Zero
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,150);
glVertex2i(230,150);
glVertex2i(230,200);
glVertex2i(170,200);
glEnd();
glFlush();

//*************
// Dot
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,150);
glVertex2i(310,150);
glVertex2i(310,200);
glVertex2i(250,200);
glEnd();
glFlush();

//*************
// Equal =
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,150);
glVertex2i(430,150);
glVertex2i(430,200);
glVertex2i(330,200);
glEnd();
glFlush();

//*************
// One
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,220);
glVertex2i(230,220);
glVertex2i(230,270);
glVertex2i(170,270);
glEnd();
glFlush();

//*************
// Two
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,220);
glVertex2i(310,220);
glVertex2i(310,270);
glVertex2i(250,270);
glEnd();
glFlush();

//*************
// Three
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,220);
glVertex2i(390,220);
glVertex2i(390,270);
glVertex2i(330,270);
glEnd();
glFlush();

//*************
// Four
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,290);
glVertex2i(230,290);
glVertex2i(230,340);
glVertex2i(170,340);
glEnd();
glFlush();

//*************
// Five
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,290);
glVertex2i(310,290);
glVertex2i(310,340);
glVertex2i(250,340);
glEnd();
glFlush();

//*************
// Six
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,290);
glVertex2i(390,290);
glVertex2i(390,340);
glVertex2i(330,340);
glEnd();
glFlush();

//*************
// Seven
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(170,360);
glVertex2i(230,360);
glVertex2i(230,410);
glVertex2i(170,410);
glEnd();
glFlush();

//*************
// Eight
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(250,360);
glVertex2i(310,360);
glVertex2i(310,410);
glVertex2i(250,410);
glEnd();
glFlush();

//*************
// Nine
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_QUADS);
glVertex2i(330,360);
glVertex2i(390,360);
glVertex2i(390,410);
glVertex2i(330,410);
glEnd();
glFlush();

//*************
// Plus +
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,150);
glVertex2i(520,150);
glVertex2i(520,270);
glVertex2i(450,270);
glEnd();
glFlush();

//*************
// Minus -
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,290);
glVertex2i(520,290);
glVertex2i(520,350);
glVertex2i(450,350);
glEnd();
glFlush();

//*************
// Division /
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,370);
glVertex2i(520,370);
glVertex2i(520,430);
glVertex2i(450,430);
glEnd();
glFlush();

//*************
// Multiply *
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(450,450);
glVertex2i(520,450);
glVertex2i(520,510);
glVertex2i(450,510);
glEnd();
glFlush();
glColor3f(1.0, 1.0, 1.0);
glRasterPos2i(475,470); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '*'); // PRINT LETTER K
glRasterPos2i(475,390); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '/');
glRasterPos2i(475,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '-');
glRasterPos2i(475,200); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '+');
glRasterPos2i(370,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '=');
glRasterPos2i(270,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '.');
glRasterPos2i(200,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '0');
glRasterPos2i(120,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'C');
glRasterPos2i(100,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(120,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'N');
glRasterPos2i(100,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(115,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(125,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(200,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '1');
glRasterPos2i(290,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '2');
glRasterPos2i(360,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '3');
glRasterPos2i(200,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '4');
glRasterPos2i(290,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '5');
glRasterPos2i(360,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '6');
glRasterPos2i(200,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '7');
glRasterPos2i(290,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '8');
glRasterPos2i(360,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '9');
glFlush();

}
if (C == 2){
//*****************************
// Change Calculator Shape
//*****************************
glClear(GL_COLOR_BUFFER_BIT); /* Clear the Window */
glColor3f(0.0, 0.0, 0.0);
//*************
// Border
//*************
glBegin(GL_QUADS);
glVertex2i(80,100);
glVertex2i(590,100);
glVertex2i(590,710);
glVertex2i(80,710);
glEnd();
glFlush();

//*************
// Screen
//*************
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,590);
glVertex2i(580,590);
glVertex2i(580,670);
glVertex2i(90,670);
glEnd();
glFlush();

//*************
// Clear
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glVertex2i(90,150);
glVertex2i(150,150);
glVertex2i(150,200);
glEnd();
glFlush();


//*************
// ON
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glVertex2i(90,230);
glVertex2i(150,230);
glVertex2i(150,280);
glEnd();
glFlush();


//*************
// OFF
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glVertex2i(90,310);
glVertex2i(150,310);
glVertex2i(150,360);
glEnd();
glFlush();

//*************
// Zero
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(170,150);
glVertex2i(230,150);
glVertex2i(230,200);
glEnd();
glFlush();

//*************
// Dot
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(250,150);
glVertex2i(310,150);
glVertex2i(310,200);
glEnd();
glFlush();

//*************
// Equal =
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(330,150);
glVertex2i(430,150);
glVertex2i(430,200);
glEnd();
glFlush();

//*************
// One
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(170,220);
glVertex2i(230,220);
glVertex2i(230,270);
glEnd();
glFlush();

//*************
// Two
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(250,220);
glVertex2i(310,220);
glVertex2i(310,270);
glEnd();
glFlush();

//*************
// Three
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(330,220);
glVertex2i(390,220);
glVertex2i(390,270);
glEnd();
glFlush();

//*************
// Four
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(170,290);
glVertex2i(230,290);
glVertex2i(230,340);
glEnd();
glFlush();

//*************
// Five
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(250,290);
glVertex2i(310,290);
glVertex2i(310,340);
glEnd();
glFlush();

//*************
// Six
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(330,290);
glVertex2i(390,290);
glVertex2i(390,340);
glEnd();
glFlush();

//*************
// Seven
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(170,360);
glVertex2i(230,360);
glVertex2i(230,410);
glEnd();
glFlush();

//*************
// Eight
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(250,360);
glVertex2i(310,360);
glVertex2i(310,410);
glEnd();
glFlush();

//*************
// Nine
//*************
glColor3f(0.26, 0.45, 0.80);
glBegin(GL_TRIANGLES);
glVertex2i(330,360);
glVertex2i(390,360);
glVertex2i(390,410);
glEnd();
glFlush();

//*************
// Plus +
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glVertex2i(450,150);
glVertex2i(520,150);
glVertex2i(520,270);
glEnd();
glFlush();

//*************
// Minus -
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glVertex2i(450,290);
glVertex2i(520,290);
glVertex2i(520,350);
glEnd();
glFlush();

//*************
// Division /
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glVertex2i(450,370);
glVertex2i(520,370);
glVertex2i(520,430);
glEnd();
glFlush();

//*************
// Multiply *
//*************
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_TRIANGLES);
glVertex2i(450,450);
glVertex2i(520,450);
glVertex2i(520,510);
glEnd();
glFlush();

glColor3f(1.0, 1.0, 0.0);
glRasterPos2i(495,470); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '*'); // PRINT LETTER K
glRasterPos2i(495,390); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '/');
glRasterPos2i(485,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '-');
glRasterPos2i(485,160); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '+');
glRasterPos2i(370,160); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '=');
glRasterPos2i(270,160); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '.');
glRasterPos2i(200,160); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '0');
glRasterPos2i(120,160); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'C');
glRasterPos2i(110,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'O');
glRasterPos2i(120,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'N');
glRasterPos2i(120,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'O');
glRasterPos2i(130,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'F');
glRasterPos2i(135,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, 'F');
glRasterPos2i(200,230); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '1');
glRasterPos2i(290,230); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '2');
glRasterPos2i(360,230); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '3');
glRasterPos2i(200,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '4');
glRasterPos2i(290,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '5');
glRasterPos2i(360,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '6');
glRasterPos2i(200,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '7');
glRasterPos2i(290,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '8');
glRasterPos2i(360,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '9');
glFlush();
}
if (C == 3){

//*****************************
// Change Keys Colour
//*****************************

glColor3f(0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT); /* Clear the Window */
//*************
// Border
//*************
glBegin(GL_QUADS);
glVertex2i(80,100);
glVertex2i(590,100);
glVertex2i(590,710);
glVertex2i(80,710);
glEnd();
glFlush();

//*************
// Screen
//*************
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,590);
glVertex2i(580,590);
glVertex2i(580,670);
glVertex2i(90,670);
glEnd();
glFlush();

//*************
// Clear
//*************
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,150);
glVertex2i(150,150);
glVertex2i(150,200);
glVertex2i(90,200);
glEnd();
glFlush();


//*************
// ON
//*************
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,230);
glVertex2i(150,230);
glVertex2i(150,280);
glVertex2i(90,280);
glEnd();
glFlush();


//*************
// OFF
//*************
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(90,310);
glVertex2i(150,310);
glVertex2i(150,360);
glVertex2i(90,360);
glEnd();
glFlush();

//*************
// Zero
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(170,150);
glVertex2i(230,150);
glVertex2i(230,200);
glVertex2i(170,200);
glEnd();
glFlush();

//*************
// Dot
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(250,150);
glVertex2i(310,150);
glVertex2i(310,200);
glVertex2i(250,200);
glEnd();
glFlush();

//*************
// Equal =
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(330,150);
glVertex2i(430,150);
glVertex2i(430,200);
glVertex2i(330,200);
glEnd();
glFlush();

//*************
// One
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(170,220);
glVertex2i(230,220);
glVertex2i(230,270);
glVertex2i(170,270);
glEnd();
glFlush();

//*************
// Two
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(250,220);
glVertex2i(310,220);
glVertex2i(310,270);
glVertex2i(250,270);
glEnd();
glFlush();

//*************
// Three
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(330,220);
glVertex2i(390,220);
glVertex2i(390,270);
glVertex2i(330,270);
glEnd();
glFlush();

//*************
// Four
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(170,290);
glVertex2i(230,290);
glVertex2i(230,340);
glVertex2i(170,340);
glEnd();
glFlush();

//*************
// Five
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(250,290);
glVertex2i(310,290);
glVertex2i(310,340);
glVertex2i(250,340);
glEnd();
glFlush();

//*************
// Six
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(330,290);
glVertex2i(390,290);
glVertex2i(390,340);
glVertex2i(330,340);
glEnd();
glFlush();

//*************
// Seven
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(170,360);
glVertex2i(230,360);
glVertex2i(230,410);
glVertex2i(170,410);
glEnd();
glFlush();

//*************
// Eight
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(250,360);
glVertex2i(310,360);
glVertex2i(310,410);
glVertex2i(250,410);
glEnd();
glFlush();

//*************
// Nine
//*************
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glVertex2i(330,360);
glVertex2i(390,360);
glVertex2i(390,410);
glVertex2i(330,410);
glEnd();
glFlush();

//*************
// Plus +
//*************
glColor3f(1.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(450,150);
glVertex2i(520,150);
glVertex2i(520,270);
glVertex2i(450,270);
glEnd();
glFlush();

//*************
// Minus -
//*************
glColor3f(1.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(450,290);
glVertex2i(520,290);
glVertex2i(520,350);
glVertex2i(450,350);
glEnd();
glFlush();


//*************
// Division /
//*************
glColor3f(1.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(450,370);
glVertex2i(520,370);
glVertex2i(520,430);
glVertex2i(450,430);
glEnd();
glFlush();

//*************
// Multiply *
//*************
glColor3f(1.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2i(450,450);
glVertex2i(520,450);
glVertex2i(520,510);
glVertex2i(450,510);
glEnd();
glFlush();

glColor3f(1.0, 1.0, 1.0);
glRasterPos2i(475,470); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '*'); // PRINT LETTER K
glRasterPos2i(475,390); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '/');
glRasterPos2i(475,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '-');
glRasterPos2i(475,200); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '+');
glColor3f(1.0, 0.0, 0.0);
glRasterPos2i(370,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '=');
glRasterPos2i(270,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '.');
glRasterPos2i(200,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '0');
glRasterPos2i(120,170); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, 'C');
glRasterPos2i(100,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(120,320); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'N');
glRasterPos2i(100,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'O');
glRasterPos2i(115,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(125,250); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'F');
glRasterPos2i(200,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '1');
glRasterPos2i(290,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '2');
glRasterPos2i(360,240); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '3');
glRasterPos2i(200,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '4');
glRasterPos2i(290,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '5');
glRasterPos2i(360,300); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '6');
glRasterPos2i(200,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '7');
glRasterPos2i(290,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '8');
glRasterPos2i(360,370); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, '9');
glFlush();
}
}

void displayFcn (void)
{

glColor3f(0.0, 0.0, 0.0);
glRasterPos2i(100,600); //GO TO POSITION (X, Y)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, '0');
glFlush();
}


void mousePtPlot (GLint button, GLint action, GLint xMouse, GLint yMouse)
{
if (button == GLUT_LEFT_BUTTON && action == GLUT_DOWN){

displayFcn();

}

}


void main( )
{
glutInitDisplayMode( GLUT_SINGLE| GLUT_RGB);
glutInitWindowSize(800,800);
glutInitWindowPosition(200,200);
glutCreateWindow("Haytham");
glutDisplayFunc(display);
glutSpecialFunc(GOGO);
myinit();
R_menu = glutCreateMenu(Red_Menu);
glutAddMenuEntry("Change Calculator Colour", 1);
glutAddMenuEntry("Change Calculator Shape", 2);
glutAddMenuEntry("Change Keys Colour", 3);
glutAttachMenu(GLUT_RIGHT_BUTTON);
glutMouseFunc (mousePtPlot);
glutDisplayFunc (displayFcn);
glutMainLoop();
}

Carmine
01-17-2016, 04:20 PM
You have declared two display functions using glutDisplayFunc. One of them is being ignored.
I'm curious to see what your graphics look like. Are you seeing what you expected?
Can you post a screen capture? Thanks.