0

I'm pretty new to opengl but been using c++ for a while now. How can I display variables using this? I can display single characters by using

glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,'0');

Why can I not use

int x = 0;
glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,x);

Compiles but won't display anything.

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by sfrider0
1

Haven't used it for a while, but I think it takes the ascii value in int form.

if you wan't to use variable use a char variable

char print ='0';
for(print = '0'; print != '9'; print++)
  glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN, print);

Also google the function, and you get a documentation, like this

Edited by firstPerson: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.