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

This is a discussion on How Do I Display And Int's Value In OpenGL? within the Game Programming forums, part of the General Programming Boards category; It's probably very simple, but if you could help me, I'd really apprechiate it....

  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-20-2008, 11:15 PM
  2. How to display a 64-bit integer?
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 02-13-2002, 10:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21