Display variables using opengl

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2008
Posts: 89
Reputation: sfrider0 is an unknown quantity at this point 
Solved Threads: 0
sfrider0 sfrider0 is offline Offline
Junior Poster in Training

Display variables using opengl

 
0
  #1
Sep 25th, 2009
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
  1. glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,'0');
Why can I not use
  1. int x = 0;
  2. glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,x);
Compiles but won't display anything.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1,279
Reputation: firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice 
Solved Threads: 157
firstPerson's Avatar
firstPerson firstPerson is offline Offline
Nearly a Posting Virtuoso

Re: Display variables using opengl

 
1
  #2
Sep 25th, 2009
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

  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.
1) What word becomes shorter if you add a letter to it? [ Solved by : niek_e, Paul Thompson]
2) What does this sequence  equal to :  (.5u - .5a)(.5u-.5b)(.5u-.5c) ...[*]
      [*solved by : murtan]
3) What is the 123456789 prime numer?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 89
Reputation: sfrider0 is an unknown quantity at this point 
Solved Threads: 0
sfrider0 sfrider0 is offline Offline
Junior Poster in Training

Re: Display variables using opengl

 
0
  #3
Sep 25th, 2009
Thank you! that worked
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC