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 4 of 4

Thread: Writing a text string

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2004
    Location
    southeast Michigan
    Posts
    6

    Writing a text string

    I am trying to write a text string to the graphics
    window. Using GLUT, I can write a string to the
    non-graphics window but this is not very desirable.

    I am usung Win-32 GLUT in my application. I have
    not yet found any way to do this. How do I proceed?

    Also, is there any way to control the size,
    position or even the existance of the non-graphics
    window. I realize that standars I/O is done via
    this window. I am aware that the compiler can
    control this behavior but is there any OpenGl or
    GLUT way of doing this also?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: Writing a text string

    Hi !

    All text support is explained in the glut manual.

    You might also want to take a look at FreeType (this is a library to use TT fonts), there are add on libraries for this to make it possible to render TT fonts in OpenGL without any platform dependencies.

    GLUT has no support for controling the text in the console window (which I assume you are talking about), this is up to the operating system.

    You might want to try to play around with ansi escape character strings to control color of text in the console window, this works on many operating systems today.

    Mikael

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2004
    Location
    southeast Michigan
    Posts
    6

    Re: Writing a text string

    Thank you. I suspected that text strings were not
    directly supported. You confirmed my conclusions.

    As for controlling the console window. If I can
    find a way to display text in the graphics window,
    I am interested in resixing the default size of the
    console window to make it much smaller. Ideally,
    I want to eliminate it altogether. Since the
    console window is under operating system control,
    I will start to look there.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: Writing a text string

    Hi !

    You do not need to have any console window, this all depends on how you link your application (console or win32), if you link it as a win32 application no console window will need to be created, but it will need a WinMain function.

    Mikael

Posting Permissions

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