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: How to draw text in the screen ?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    How to draw text in the screen ?

    it is possible to draw text on screen, without using glut and glu?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    721
    There is not direct support for text in OpenGL. You have to use some library.

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421
    Quote Originally Posted by Washiro View Post
    it is possible to draw text on screen, without using glut and glu?
    http://www.opengl.org/wiki/FAQ#Font_...Text_Rendering
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  4. #4
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    2
    Check lesson 17 and 43 on http://nehe.gamedev.net
    Neon Helium might be old but they will still give you the basics how to render font/text-sprites

Posting Permissions

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