Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Writing to the screen

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2004
    Posts
    9

    Writing to the screen

    I need to write to my window. I use glutBitmapCharacter and i can use an array of characters but then i need to write numbers to the screen that are stored as an int variable. Can anyone help me with this, if you can make any sense of what ive jsut written.

    Cheers,

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Posts
    102

    Re: Writing to the screen

    You can sprintf the int into a string, then print it...

  3. #3
    Intern Newbie
    Join Date
    Jan 2004
    Location
    Keller, TX
    Posts
    42

    Re: Writing to the screen

    Nothing like a code example...

    int value = 16;
    char outputTxt[100];

    sprintf( outputTxt, "I have %d textures in my map.", value );

    The outputTxt character string says:
    I have 16 textures in my map.

    or

    sprintf( outputTxt, "%d", value );

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •