Skip to content

Instantly share code, notes, and snippets.

@rajan9519
Last active April 28, 2020 05:53
Show Gist options
  • Select an option

  • Save rajan9519/b8e33d71b04c9b71c8869a8720cd69d0 to your computer and use it in GitHub Desktop.

Select an option

Save rajan9519/b8e33d71b04c9b71c8869a8720cd69d0 to your computer and use it in GitHub Desktop.
void drawBitmapString(int x,int y,std::string s)
{
glColor3f(1.0f,1.0f,1.0f); // sets color of the text
glRasterPos2f(x, y);// screen coordinate at which text will appear
int length = s.size();
// writing charater by charater on the screen
for(int i=0;i<length;i++)
{
glutBitmapCharacter( GLUT_BITMAP_HELVETICA_18, s[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment