text: OpenGL Discussion and Help Forums
  >
  DEVELOPERS
  >
  OpenGL on Linux
  > how to print a dynamic string on the screen
  PDA
  View Full Version :
  how to print a dynamic string on the screen
  debs
  03-23-2007, 08:24 AM
  actually i'm doing a radar display system.. i have to prprint strings on the screen.. but i dont know how to do this.. can u plz guide me how to do so.
  debs
  03-23-2007, 01:56 PM
  hey ppl i need to print an array of strings using opengl. can u tell me the command to so..
  i know only 1 command -> glBitmapCharacter() to print a single character at a time.. but my prob is to print a dynamic array of strings like
  char **string={"hi","hello","fine");
  can u plz tell me the command to do so.. it will be a tedious job to do so using the above command.. cos my string is also generated at runtime only..
  thinks
  03-23-2007, 06:58 PM
  The GLUT libraries have string printing functions. Have a look there and re-post if you need more help.
  debs
  03-24-2007, 10:52 AM
  i'm not able to find any such libraries.. can u plz tell me any such library so that i can search them on net.
  i got something from net as shown below which can be helpful to me.. but its not recognized by my system.. i have fedora core 3.. may be it has a old version of opengl.. can u tell me where to download its new version.
  the below mentioned header file is also not recognized..
  #include <gl\glaux.h>
  GLvoid glPrint(const char *fmt, ...) // Custom GL "Print" routine
  {
  glPushAttrib(GL_LIST_BIT); // Pushes the display list bits
  glListBase(base - 32); // Sets the base character to 32
  glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws the display list text
  glPopAttrib(); // Pops the display list bits
  }et..
  OneSadCookie
  03-25-2007, 05:48 AM
  svn co
  svn co
  It's a little buggy with centered/right-aligned text, and not massively efficient, but it's easy enough to use.
  Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.