//Yay #include //We need these for the log #include #include #include //This is for GLUT #include //Can't forget this ;-) using namespace std; //struct point { // int v; // int c[3]; //} int points[6]; float colors[6][3]; FILE *pLog; string s1; string s2; double WIDTH = 400; double HEIGHT = 400; double HMIN = -1*(WIDTH/2); double HMAX = WIDTH/2; double KMIN = -1*(HEIGHT/2); double KMAX = HEIGHT/2; void keyboard(unsigned char key, int x, int y) { if (key==27) exit(0); double X = x*(HMAX*HMIN)/(WIDTH+HMIN); double Y = (HEIGHT-Y)*(KMAX-KMIN)/(HEIGHT+KMIN); string s = " "; s[0]=key; drawString(X,Y, GLUT_BITMAP_8_BY_13, s); glutPostRedisplay(); } void display() { glClear(GL_COLOR_BUFFER_BIT); //Beggining out shape (Polygon) //glBegin(GL_POINTS); /* glColor3f(1,0,1); //Quad 1 for(int i=-300;i<300;i++) { glColor3f(1,0,1); glVertex3f(i,i,0); } for(int i=-300;i<300;i++) { glColor3f(2,0,1); glVertex3f(i,i,0); } for(int i=-300;i<300;i++) { glColor3f(2,0,1); glVertex3f(i+1,i+1,0); } glEnd(); //End the shape glBegin(GL_LINES); glColor3f(1,1,1); glVertex3f(10,10,0); glVertex3f(-10,-10,0); glVertex3f(40,40,0); glVertex3f(20,20,0); //////////////////// glVertex3f(-40,-40,0); glVertex3f(-40,30,0); glVertex3f(30,30,0); glVertex3f(30,-40,0); glVertex3f(40,40,0); glVertex3f(-40,-40,0); glEnd(); glBegin(GL_TRIANGLE_STRIP); glColor3f(1,1,1); glVertex3f(-40,-40,0); glColor3f(.1,0,.8); glVertex3f(-40,30,0); glColor3f(1,0,1); glVertex3f(30,30,0); glColor3f(1,.3,1); glVertex3f(30,30,0); glVertex3f(30,40,0); glColor3f(0,0,.9); glVertex3f(30,40,0); glVertex3f(40,40,0); glColor3f(.9,.2,0); glVertex3f(400,30,0); glColor3f(0,.2,.4); glVertex3f(30,13,0); glVertex3f(1,1,0); glColor3f(.1,.2,0); glVertex3f(30,30,0); glColor3f(.3,.3,.1); glVertex3f(40,1,0); glEnd(); glBegin(GL_QUAD_STRIP); glColor3f(.3,.3,.1); glVertex3f(60,60,0); glColor3f(0,.3,.1); glVertex3f(60,30,0); glColor3f(1,.3,0); glVertex3f(30,30,0); glColor3f(.3,3,.1); glVertex3f(30,60,0); glVertex3f(60,60,0); glEnd(); glEnd(); ///////////////// glBegin(GL_TRIANGLES); glColor3f(colors[0][0],colors[0][1],colors[0][2]); glVertex3f(points[0],points[1],0); glColor3f(colors[1][0],colors[1][1],colors[1][2]); glVertex3f(points[2],points[3],0); glColor3f(colors[2][0],colors[2][1],colors[2][2]); glVertex3f(points[4],points[5],0); glEnd(); glBegin(GL_QUAD_STRIP); glColor3f(.3,3,.1); glVertex3f(70,0,50); glVertex3f(20,0,50); glVertex3f(70,70,50); glVertex3f(0,0,50); glVertex3f(0,50,50); /// glColor3f(0,.3,.1); glVertex3f(20,20,0); glVertex3f(20,70,0); glVertex3f(70,70,0); glVertex3f(70,20,0); glEnd(); glBegin(GL_QUADS); glColor3f(0,.3,.1); glVertex3f(20,20,0); glVertex3f(20,70,0); glColor3f(.3,3,.1); glVertex3f(70,70,0); glVertex3f(70,20,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(69,19,0); glVertex3f(20,-60,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(68,17,0); glVertex3f(20,-60,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(70,20,0); glVertex3f(20,-60,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(71,21,0); glVertex3f(19,-59,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(72,22,0); glVertex3f(18,-58,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(73,23,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(74,24,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(75,25,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(77,27,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(79,29,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(81,31,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(83,33,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(85,35,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(87,37,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(89,39,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(91,41,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(93,43,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(95,45,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(97,47,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(99,49,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(101,51,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(103,53,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(105,55,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(107,57,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(109,59,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(111,51,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(113,53,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(116,56,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(108,58,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(117,68,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(119,70,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(121,72,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(123,74,0); glVertex3f(17,-57,0); glEnd(); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(125,76,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(127,78,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(129,80,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(131,82,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(133,84,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(135,86,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(137,88,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(139,90,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(141,92,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(143,94,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(145,96,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(147,98,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(149,100,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(151,102,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(153,104,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(155,106,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(157,108,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(159,110,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(161,112,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(163,114,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(165,116,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(167,118,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(169,120,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(171,122,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(173,124,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(176,126,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(178,128,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(180,130,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(182,132,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(184,134,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(186,136,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(189,139,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(191,141,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(193,143,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(195,145,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(197,147,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(199,149,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(201,151,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(203,153,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(205,155,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(207,157,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(209,159,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(211,161,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(213,161,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(215,163,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(217,165,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(219,167,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(221,169,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(223,171,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(225,173,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(227,175,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(229,177,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(229,177,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(231,179,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(233,181,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(235,183,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(237,185,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(239,187,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(241,189,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(243,191,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(245,193,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(247,195,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(249,197,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(251,199,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(253,201,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(255,203,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(255,205,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(257,207,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(259,209,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(261,211,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(263,213,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(265,215,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(267,217,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(269,219,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(271,221,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(273,223,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(275,225,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(277,227,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(279,229,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(281,231,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(283,234,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(285,236,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(287,238,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(289,240,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(291,242,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(293,244,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(295,246,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(297,248,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_LINE_STRIP); glColor3f(0,0,0); glVertex3f(299,250,0); glVertex3f(17,-57,0); glEnd(); glBegin(GL_QUADS); glColor3f(1,1,1); glVertex3f(10,10,0); glVertex3f(10,20,0); glVertex3f(20,20,0); glVertex3f(20,10,0); glEnd(); glTranslatef(50,50,0); glBegin(GL_QUADS); glColor3f(.1,.5,.5); glVertex3f(10,10,0); glVertex3f(10,20,0); glVertex3f(20,20,0); glVertex3f(20,10,0); glEnd(); glBegin(GL_QUADS); glColor3f(.1,0,.2); glVertex3f(0,0,1); glVertex3f(0,20,1); glVertex3f(40,20,1); glVertex3f(40,0,1); glEnd(); glTranslatef(-50,-50,0); glPushMatrix(); glRotatef(90,0,0,1); glScalef(.2,.20,.20); glPopMatrix(); */ glColor3f(1,1,1); int tt = -90; glRasterPos3f(tt,0,0); glColor3f(1,1,1); for(int i=0;i<(signed int)s1.length();i++) { glutBitmapCharacter(GLUT_BITMAP_8_BY_13, s1[i]); } glColor3f(1,0,.1); glRasterPos3f(tt,50,0); for(int i=0;i<(signed int)s2.length();i++) { glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, s2[i]); } //Use this or you'll kill us all!! glutSwapBuffers(); } int main(int argc, char **argv) { //GLUTMOTIONFUNC(x,y) //1 - Mouse move with mouse button //GLUTPASSIVEMOTIONFUNC(x,y) //Mouse mvoe not pressed //////////////////////////////////////////////// // FONTS // // GLUT_BITMAP_TIMES_ROMAN_10 (10 and 24) // // GLUT_BITMAP_8_BY_13 // // GLUT_BITMAP_HELVETICA_(10, 12, or 18) // /////////////////////////////////////////// // glRasterPos3f(x,y,z) - To set cursor position // glutBitmapCharacter(font, character); /////////////////////////////////////////////// //Redirect stdout to the log //if((pLog=freopen("log.txt","w", stdout))==NULL) { exit(-1); } //Always standard, pretty much never changes! glutInit(&argc, argv); /* for(int z=0;z<6;z++) { cout << "\nEnter point " << z << ": "; cin >> points[z]; } for(int zj=0;zj<6;zj++) { for(int j=0;j<3;j++) { cout << "\nEnter color " << zj << ": "; cin >> colors[zj][j]; } } */ glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowPosition(100,100); //Set windows geometry (In this case 400, 400) For fullscreen use glutFullScreen() instead! glutInitWindowSize(400,400); //Name your window. glutCreateWindow("TITLE!!!"); //glMatrixMode(GL_MODEL_VIEW); - Needed to start matrix //glPushMatrix() - Before what you want to undo //glPopMatrix() - When you wannt to undo cout << "Enter string 1: "; cin >> s1; cout << "\nEnter string 2: "; cin >> s2; //Complicated, has to do with stretching. //glOrtho(-100,100,-100,100,-1,1); glOrtho(-100,100,-100,100,-50,50); //Clears to color. (Also you can change bg color) glClearColor(0,0,0,0); //For example 1,1,1 is white, right now it's black, yellow is 1,1,0, 0,.5,1 for sky blue, 0,0,.3 for dark blue. glColor3f(0,0,0); glutDisplayFunc(display); //Runs the mainloop. glutMainLoop(); fclose(pLog); return 0; // GLUT_KEY_F1-12 // GLUT_KEY_LEFT, RIGHT, UP, DOWN, PAGE_DOWN, PAGE_UP }