943,602 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 1178
  • C++ RSS
Sep 25th, 2009
0

Display variables using opengl

Expand Post »
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
C++ Syntax (Toggle Plain Text)
  1. glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,'0');
Why can I not use
C++ Syntax (Toggle Plain Text)
  1. int x = 0;
  2. glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,x);
Compiles but won't display anything.
Similar Threads
Reputation Points: 16
Solved Threads: 0
Junior Poster
sfrider0 is offline Offline
149 posts
since Oct 2008
Sep 25th, 2009
1

Re: Display variables using opengl

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

C++ Syntax (Toggle Plain Text)
  1. char print ='0';
  2. for(print = '0'; print != '9'; print++)
  3. glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN, print);

Also google the function, and you get a documentation, like this
Last edited by firstPerson; Sep 25th, 2009 at 7:21 pm.
Reputation Points: 840
Solved Threads: 594
Senior Poster
firstPerson is offline Offline
3,862 posts
since Dec 2008
Sep 25th, 2009
0

Re: Display variables using opengl

Thank you! that worked
Reputation Points: 16
Solved Threads: 0
Junior Poster
sfrider0 is offline Offline
149 posts
since Oct 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: calling a constructor in a constructor
Next Thread in C++ Forum Timeline: compile error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC