Thread: How Do I Display And Int's Value In OpenGL?

  1. #1
    People Love Me
    Join Date
    Jan 2003
    Posts
    412

    Question How Do I Display And Int's Value In OpenGL?

    It's probably very simple, but if you could help me, I'd really apprechiate it.

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    >>Then use the standard OpenGL function for drawing a text string.
    I don't think there is one.

    I think that NeHe has a tutorial or two for drawing text in OpenGL.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    People Love Me
    Join Date
    Jan 2003
    Posts
    412
    Originally posted by Salem
    Yeah, use sprintf() to create a string in memory, converting whatever you want into a string.
    Then use the standard OpenGL function for drawing a text string.
    Can you gimme an example of how to do that?

    I dont think I've ever used sprintf() before.

  4. #4
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Code:
    char s[256];
    int n  = 10;
    sprintf( s, "The value of n is %d", n );
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. assigning ints into a string
    By shintaro in forum C++ Programming
    Replies: 7
    Last Post: 11-21-2008, 12:15 AM
  2. How to display a 64-bit integer?
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 02-13-2002, 11:13 PM