title: How to display shape and text on OpenGL screen simultaneously?
body: <p>The below code works perfectly fine with no fatal error but, when i use arguments "w","h" in "gluortho2d" as gluortho2d(0,w,h,0) in reshape function I get text on screen whereas if I put these arguments "0,0" as gluortho2d(0,0,0,0) I get shape of box.
  How can I get both of them(box and text) simultaneously on screen?</p>
  
  <pre><code>#include"glut.h"
  
  void drawBitmapText(char *string, float x, float y, float z);
  void reshape(int w, int h);
  void display(void);
  
  void drawBitmapText(char *string, float x, float y, float z)
  {
      char *c;
      glRasterPos3f(x, y, z);//define position on the screen where to draw text.
  
      for (c = string; *c != '\0'; c++)
      {
          glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, *c);
      }
  }
  
  void reshape(int w, int h)
  {
      glViewport(0, 0, w, h);
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();//Resets to identity Matrix.
      gluOrtho2D(0, w, h, 0);
      glMatrixMode(GL_MODELVIEW);
      glLoadIdentity();
  
  }
  
  void display(void)
  {
  
      glBegin(GL_POLYGON);//1
      glVertex2f(-0.2, 0.6 - 0.3);
      glVertex2f(-0.1, 0.6 - 0.3);
      glVertex2f(-0.1, 0.5 - 0.3);
      glVertex2f(-0.2, 0.5 - 0.3);
      glEnd();
  
  
      glColor3f(0, 1, 0);
      drawBitmapText("Usama Ishfaq", 200, 400, 0);//drawBitmapText("Usama Ishfaq", x(how much right), y(how much down), z);
  
      glutSwapBuffers();
  }
  
  
  int main(int argc, char* argv[])
  {
      glutInit(&amp;argc, argv);
      glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); 
      glutInitWindowSize(500, 500);
      glutInitWindowPosition(100, 100);
      glutCreateWindow("Usama OGL Window");
      glutDisplayFunc(display);
      glutReshapeFunc(reshape);
      glutMainLoop();
  
      return 0;
  }
  </code></pre>