GLvoid glPrint(const char *fmt, ...) // Custom GL "Print" Routine { char text[256]; // Holds Our String va_list ap; // Pointer To List Of Arguments if (fmt == NULL) // If There's No Text return; // Do Nothing va_start(ap, fmt); // Parses The String For Variables vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers va_end(ap); // Results Are Stored In Text 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 }
void Font::printf(char *format, ...) { char buffer[1000]; int len; va_list ap; va_start(ap, format); vsprintf(buffer, format, ap); va_end(ap); glEnable(GL_POLYGON_SMOOTH); len = strlen(buffer); glListBase(base); glCallLists(len, GL_UNSIGNED_BYTE, buffer); glDisable(GL_POLYGON_SMOOTH); }
/* Custom GL "Print" routine */ GLvoid glPrint(const char *fmt, ...) { char lpszText[STRING_BUFFER]; // Hold string va_list pLstArg; // Pointer to list of arguments if (NULL == fmt) // If there's no text { return; // Do nothing } va_start(pLstArg, fmt); // Parses The String For Variables //vsprintf(lpszText, fmt, pLstArg); // And Converts Symbols To Actual Numbers vsprintf_s(lpszText, fmt, pLstArg); //vsprintf(lpszText,) va_end(pLstArg); // Results Are Stored In Text glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits glListBase(g_uBase - VK_SPACE); // Sets The Base Character to 32 glCallLists(strlen(lpszText), GL_UNSIGNED_BYTE, lpszText); // Draws The Display List Text glPopAttrib(); // Pops The Display List Bits }
void GLFont::printf(const char *fmt, ...) { if (fmt == NULL) // If There's No Text return; // Do Nothing va_list ap; char text[1024]; // Holds Our String va_start(ap, fmt); // Parses The String For Variables vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers va_end(ap); // Results Are Stored In Text glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits glListBase(mIdBaseList - 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 }
void GlConsoleWindow::draw() { if (is_shown()) { glPushMatrix(); glBindTexture(GL_TEXTURE_2D, font_->get_texture()->get_index()); glListBase(font_->get_displaylist()); int lineno = (top_ == 0) ? kLINE_COUNT - 1 : top_ - 1; for (int i = 0; i < kLINE_COUNT; ++i) { glLoadIdentity(); glTranslatef(0, i*kFONT_HEIGHT, 0); //std::cout << "draw " << console_[i].size() << " "; glCallLists(console_[lineno].size(), GL_BYTE, console_[lineno].c_str()); lineno = (lineno == 0) ? kLINE_COUNT - 1 : lineno - 1; } glPopMatrix(); } }
void cWindowTextShower::glPrint(const char *fmt, double _x, double _y, double _z) { char text[256]; // Holds our string va_list ap; // Pointer to list of arguments if (fmt == NULL) return; glRasterPos3d(_x, _y, _z); va_start(ap, fmt); // Parses the string for variables vsprintf(text, fmt, ap); // And converts symbols to actual numbers va_end(ap); // Results are stored in text glPushAttrib(GL_LIST_BIT); // Pushes the display list bits glListBase(mBase - 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 }
void CGLFont::entext( float x,float y, LPCTSTR str, HFONT hFont, float r, float g, float b) //平面字符显示,不支持汉字。 { HDC hdc = wglGetCurrentDC(); //获取设置场景 SelectObject(hdc, hFont); //设置字体 unsigned int Base = glGenLists(96); //创建大小为96显示列表,存放字符位图 wglUseFontBitmaps(hdc, 32, 96,Base);//创建位图字体 glDisable(GL_TEXTURE_2D); //不使用贴图 glDisable(GL_LIGHTING); //不使用光照 glPushAttrib(GL_LIST_BIT); //保存显示列表位属性 glColor3f(r,g,b); //颜色 glRasterPos2f(x/100, y/100); //平面定位 glListBase(Base - 32); //从显示列表开始 glCallLists(strlen(str), GL_UNSIGNED_BYTE, str); //绘制显示列表 glPopAttrib(); //恢复显示列表属性 glEnable(GL_LIGHTING); //使用贴图 glEnable(GL_TEXTURE_2D); //使用光照 glDeleteLists(Base, 96); //删除显示列表 }
void RenderPrint (int x, int y, int font, GLrgba color, const char *fmt, ...) { char text[MAX_TEXT]; va_list ap; text[0] = 0; if (fmt == NULL) return; va_start(ap, fmt); vsprintf(text, fmt, ap); va_end(ap); glPushAttrib(GL_LIST_BIT); glListBase(fonts[font % FONT_COUNT].base_char - 32); glColor3fv (&color.red); glRasterPos2i (x, y); glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); }
void OutFont::print(float x, float y, float z, const char *string) { glPushMatrix(); glDisable(GL_TEXTURE_2D); glDisable(GL_LIGHTING); //glMatrixMode(GL_PROJECTION); //glPushMatrix(); //glLoadIdentity(); // glOrtho(0,0,400,400,0,1); //glMatrixMode(GL_MODELVIEW); //glLoadIdentity(); //glScalef(1.0f,2.0f,1.0f); /*float length = 0.0f; for (unsigned int loop=0;loop<(strlen(string));loop++) // Loop To Find Text Length { length+=this->m_mf[string[loop]].gmfCellIncX; // Increase Length By Each Characters Width }*/ //glColor3f(1.0f,0.0f,0.0f); //glPushMatrix(); glTranslatef(x,y,z); glScalef(m_width, m_height, m_depth); glPushAttrib(GL_LIST_BIT); glListBase(this->m_listBase); glCallLists(strlen(string),GL_UNSIGNED_BYTE,string); glPopAttrib(); //glPopMatrix(); //glMatrixMode(GL_PROJECTION); //glPopMatrix(); //glMatrixMode(GL_MODELVIEW); glEnable(GL_LIGHTING); glEnable(GL_TEXTURE_2D); glPopMatrix(); }
void Font::DrawString(int x, int y, char* str, ...) { m_engine->SetGUIWindow(); double kx = 1.344827; char buf[1024]; va_list msg; float vPort[4]; glGetFloatv(GL_VIEWPORT, vPort); float stepX = kx*10.0f / vPort[2]; float actualX = (float(x)* stepX) - (stepX * vPort[2] / 2); float stepY = 10.0f / vPort[3]; float actualY = (stepY * vPort[3] / 2) - (float(y)* stepY); va_start(msg, str); vsprintf(buf, str, msg); va_end(msg); // glPushMatrix(); // glLoadIdentity(); glDisable(GL_TEXTURE_2D); // glTranslatef(-5.0*kx,0,0.0); glTranslatef(actualX, actualY, 0); glScalef(0.3f, 0.3f, 0.3f); glColor3f(0.0f, 1.0f, 0.0f); glPushAttrib(GL_LIST_BIT); glListBase(m_base); glCallLists(strlen(buf), GL_UNSIGNED_BYTE, buf); glPopAttrib(); // glEnable(GL_TEXTURE_2D); glColor3f(1.0f, 1.0f, 1.0f); // glPopMatrix(); m_engine->SetRenderWindow(); }
void glPrint(int x, int y, char *string, int set,bool isover800_600) // Where The Printing Happens { if(isover800_600) { x=x*800/winwidth; y=y*600/winheight; } glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA ); if (set>1) { set=1; } glBindTexture(GL_TEXTURE_2D, AsciiFontTexId); // Select Our Font Texture glDisable(GL_DEPTH_TEST); // Disables Depth Testing glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPushMatrix(); // Store The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix if(isover800_600) glOrtho(0,800,0,600,-1,1); else glOrtho(0,winwidth,0,winheight,-1,1); // Set Up An Ortho Screen glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslated(x,y,0); // Position The Text (0,0 - Bottom Left) glListBase(base-32+(128*set)); // Choose The Font Set (0 or 1) glCallLists(strlen(string),GL_UNSIGNED_BYTE,string);// Write The Text To The Screen /*glLoadIdentity(); glTranslated(wx,wy,0); glBegin(GL_QUADS); glVertex3f(-0.1f, 0.1f, -0.1f); glVertex3f( 0.1f, 0.1f, -0.1f); glVertex3f( 0.1f,-0.1f, -0.1f); glVertex3f(-0.1f,-0.1f, -0.1f); glEnd();*/ glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glPopMatrix(); // Restore The Old Projection Matrix glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPopMatrix(); // Restore The Old Projection Matrix glEnable(GL_DEPTH_TEST); // Enables Depth Testing }
// Quick print function. Limited to 8-bit characters (0-255), left alignment, one line. void font_data::qprint(float x, float y, int align, const char *fmt, ...) { // We want a coordinate system where things coresponding to window pixels. pushScreenCoordinateMatrix(); char text[256]; // Holds the string (max of 255 bytes) va_list ap; // Pointer to list of arguments if (fmt == NULL) // If there's no text *text=0; // do nothing else { va_start(ap, fmt); // Parses the string for variables vsprintf(text, fmt, ap); // and converts symbols to actual numbers va_end(ap); // Results are stored in text } glPushAttrib(GL_LIST_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT); glMatrixMode(GL_MODELVIEW); glDisable(GL_LIGHTING); glEnable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glListBase(list_base); float modelview_matrix[16]; glGetFloatv(GL_MODELVIEW_MATRIX, modelview_matrix); glPushMatrix(); glLoadIdentity(); glTranslatef(x,y,0); glMultMatrixf(modelview_matrix); // Call the display lists using the 8-bit text line. glCallLists((GLsizei) strlen(text), GL_UNSIGNED_BYTE, text); glPopMatrix(); glPopAttrib(); pop_projection_matrix(); }
void glDrawText(int x, int y, const char *strString, ...) { char strText[256]; // This will hold our text to display va_list argumentPtr; // This will hold the pointer to the argument list // If you have never used a va_list, listen up. Remember printf()? // or sprintf()? Well, you can add unlimited arguments into the text like: // printf("My name is %s and I am %d years old!", strName, age); // Well, that is what va_list's do. // First we need to check if there was even a string given if (strString == NULL) // Check if a string was given return; // Don't render anything then // First we need to parse the string for arguments given // To do this we pass in a va_list variable that is a pointer to the list of arguments. // Then we pass in the string that holds all of those arguments. va_start(argumentPtr, strString); // Parse the arguments out of the string // Then we use a special version of sprintf() that takes a pointer to the argument list. // This then does the normal sprintf() functionality. vsprintf(strText, strString, argumentPtr); // Now add the arguments into the full string va_end(argumentPtr); // This resets and frees the pointer to the argument list. // Before we draw the text, we need to position it with our own function. PositionText(x, y); // Call our own function to position the text on screen // Now, before we set the list base, we need to save off the current one. glPushAttrib(GL_LIST_BIT); // This saves the list base information // Then we want to set the list base to the font's list base, which should be 1 in our case. // That way when we call our display list it will start from the font's lists'. glListBase(g_FontListID); // This sets the lists base // Now comes the actually rendering. We pass in the length of the string, // then the data types (which are characters so its a UINT), then the actually char array. // This will then take the ASCII value of each character and associate it with a bitmap. glCallLists(strlen(strText), GL_UNSIGNED_BYTE, strText); glPopAttrib(); // Return the display list back to it's previous state }
void GLENGINE::DrawTextGl(GLVECTOR2 pos, GLCOLORARGB color, const char * text) { glColor3f(color.r, color.g, color.b); PrintErrorLine(__LINE__); glRasterPos2f(pos.x, pos.y); PrintErrorLine(__LINE__); // Must save/restore the list base. glPushAttrib(GL_LIST_BIT); PrintErrorLine(__LINE__); glListBase(listbase); PrintErrorLine(__LINE__); glCallLists(strlen(text), GL_UNSIGNED_BYTE, (const GLvoid*) text); PrintErrorLine(__LINE__); glPopAttrib(); PrintErrorLine(__LINE__); }
void Font::DrawString(const ezString& sText, const ezVec2& screenPosition, const ezColor& color) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glUseProgram(0); glColor4fv(&color.r); float screenPosX = screenPosition.x * 2.0f - 1.0f; float screenPosY = 1.0f - screenPosition.y * 2.0f; // screenPosY -= 20.0f / RenderDevice::Get().GetBackBufferHeight(); // padding due to window frame - the direct3d implementatoin is aware of it glRasterPos2f(screenPosX, screenPosY); glPushAttrib(GL_LIST_BIT); glListBase(m_DisplayList - 32); glCallLists(static_cast<GLsizei>(sText.GetElementCount()), GL_UNSIGNED_BYTE, sText.GetData()); glPopAttrib(); glDisable(GL_BLEND); }
GLvoid glPrint(GLint x, GLint y, const char *string, ...) // Where The Printing Happens { char text[256]; // Holds Our String va_list ap; // Pointer To List Of Arguments if (string == NULL) // If There's No Text return; // Do Nothing va_start(ap, string); // Parses The String For Variables vsprintf(text, string, ap); // And Converts Symbols To Actual Numbers va_end(ap); // Results Are Stored In Text glBindTexture(GL_TEXTURE_2D, textures[9].texID); // Select Our Font Texture glPushMatrix(); // Store The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix glTranslated(x,y,0); // Position The Text (0,0 - Bottom Left) glListBase(base-32); // Choose The Font Set glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws The Display List Text glPopMatrix(); // Restore The Old Projection Matrix }
void DecoStat::DrawText(DecoRenderInterface* RI, char * text, UINT posX, UINT posY, INT win_width, INT win_height) { RI->PushState(); matrix44 identity = IdentityMatrix44(); RI->SetTransform(TT_CameraToScreen, identity); RI->SetTransform(TT_WorldToCamera, identity); RI->SetTransform(TT_LocalToWorld, identity); gluOrtho2D(0, win_width, 0, win_height); RI->ResetLight(); RI->EnableDepthTest(FALSE); RI->EnableTexture(FALSE); glListBase(1000); glRasterPos3d(posX,posY,0); glCallLists((GLsizei)strlen(text),GL_UNSIGNED_BYTE,text); RI->PopState(); }
void PrintText(char* text, char* font_name, UINT x, UINT y) { if(text && font_name) { font_t* font = FontByName(font_name); if(font) { glPushAttrib(GL_LIST_BIT); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glListBase(font->base-32); glRasterPos2i(x, y + font->height); glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glPopAttrib(); } } }
void CDraw::textf( SColor& color, float x, float y, char* text, CTextFont& textFont ) { glDisable( GL_TEXTURE_2D ); glColor4f( color.r, color.g, color.b, color.a ); glRasterPos3f( x, y, 0.1f ); if( textFont.m_base != 0 && text != NULL ) { glPushAttrib( GL_LIST_BIT ); { glListBase( textFont.m_base - 32 ); glCallLists( strlen(text), GL_UNSIGNED_BYTE, text ); } glPopAttrib(); } glEnable( GL_TEXTURE_2D ); }
void ddw_surf_xy(int x, int y, const char *fmt, ...) { char text[1000]; va_list ap; // Pointer To List Of Arguments if (fmt == NULL) // If There's No Text return; // Do Nothing glColor3f(KONZOLE_COLOR, KONZOLE_COLOR, KONZOLE_COLOR); glRasterPos2i(x, y); va_start(ap, fmt); // Parses The String For Variables vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers va_end(ap); // Results Are Stored In Text glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits glListBase(hwconf.font_baze - 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 }
//Vykresleni textu void Display::PrintText(uint8 font, uint32 left, uint32 top, const char *fmt, ...) { if (font >= MAX_FONTS) return; if (!m_fontLoaded[font]) InitFont(font); glEnable(GL_BLEND); // Nabindujeme texturu s fontem BindTexture(fontTextures[font]); char text[512]; va_list ap; if (fmt == NULL) return; va_start(ap, fmt); vsprintf(text, fmt, ap); va_end(ap); // Pokud jsme ve 3D rezimu bool in3D = !IsIn2DMode(); // Prepneme do 2D if (in3D) Setup2DMode(); glLoadIdentity(); glTranslated(left,top,0); glListBase(m_fontBase[font]-32); glCallLists(strlen(text),GL_UNSIGNED_BYTE,text); glLoadIdentity(); // A po vykresleni se vratime zpet do puvodniho modu pokud je to nutne if (in3D) Setup3DMode(); }
GLvoid hud::glprint(GLint x, GLint y, int set, const char *fmt, ...){ if (fmt == NULL) return; char text[1024]; // Holds Our String va_list ap; // Pointer To List Of Arguments va_start(ap, fmt); // Parses The String For Variables vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers va_end(ap); // Results Are Stored In Text if (set>1) set=1; // If So, Select Set 1 (Italic) if (set<0) set=0; // If So, Select Set 0 (normal) glColor3f(1.0f, 1.0f, 1.0f); glEnable(GL_TEXTURE_2D); // Enable Texture Mapping glLoadIdentity(); // Reset The Modelview Matrix glTranslated(x,y,0); // Position The Text (0,0 - Top Left) glListBase(base-32+(128*set)); // Choose The Font Set (0 or 1) glScalef(1.0f,1.0f,1.0f); // Make The Text 2X Taller glCallLists(strlen(text),GL_UNSIGNED_BYTE, text); // Write The Text To The Screen glDisable(GL_TEXTURE_2D); // Disable Texture Mapping }
void GameClass::Print(float x,float y,char* Text,...) { if(!Text) return; char text[1024]; va_list ap; glPushMatrix(); va_start(ap,Text); _vsnprintf_s(text,1023,1023,Text,ap); va_end(ap); glRasterPos3f(x,y,0); glPushAttrib(GL_LIST_BIT); glListBase(StdFontBase); glCallLists(strlen(text),GL_UNSIGNED_BYTE,text); glPopAttrib(); glPopMatrix(); }
void glPrint(double x, double y, const char *fmt, ...) { char text[256]; va_list ap; if (fmt == NULL) return; // parse formatted string/args into text string va_start(ap, fmt); vsprintf(text, fmt, ap); va_end(ap); // wgl text glPushMatrix(); glTranslated(x,y,0.0f); glRasterPos2d(0.0,0.0); // draw the text glListBase(base - 32); glCallLists((GLsizei)strlen(text), GL_UNSIGNED_BYTE, text); glPopMatrix(); }
void GLFont::print( const Vector2d &pos, const std::string &text ) { _Renderer->apply_render_state( _Texture ); glDisable( GL_DEPTH_TEST ); glColor3ub( _ActiveColor.RawColor.r, _ActiveColor.RawColor.g, _ActiveColor.RawColor.b ); glMatrixMode( GL_MODELVIEW ); glPushMatrix(); glLoadIdentity(); glTranslated( pos.x, pos.y, -1 ); glListBase( _DisplayList - 32 ); glCallLists( (GLsizei)text.length(), GL_UNSIGNED_BYTE, text.c_str() ); glMatrixMode( GL_MODELVIEW ); glPopMatrix(); glColor3d( 1.0, 1.0, 1.0 ); glEnable( GL_DEPTH_TEST ); }
void DrawTextFT(const Fonte *ft_font, float x, float y, const char *text) { GLuint font=ft_font->list_base; if (text == NULL) return; glListBase(font); float modelview_matrix[16]; glGetFloatv(GL_MODELVIEW_MATRIX, modelview_matrix); glPushMatrix(); glLoadIdentity(); glTranslatef(x,y,0); glMultMatrixf(modelview_matrix); glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); glPopMatrix(); }
/*-----------------------------------------------------------------------------+ | glTextout | +-----------------------------------------------------------------------------*/ void glTextout(const CGLFont *font, const char *strText, float x, float y) { GLuint b = font->m_iList; glPushMatrix(); glRasterPos2i((int)x, (int)y); glTranslatef(x, y, 0.0f); if (font->m_FontMode == fmTexture) { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, font->m_iTexture); b-=32; glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); } glPushAttrib(GL_LIST_BIT); glListBase(b); glCallLists((GLsizei)strlen(strText), GL_UNSIGNED_BYTE, strText); glPopAttrib(); glPopMatrix(); }
void CText::Print(const char *fmt, ...) // Custom GL "Print" Routine { char text[256]; // Holds Our String va_list ap; // Pointer To List Of Arguments if (!loaded || !fmt) // If There's No Text return; // Do Nothing va_start(ap, fmt); // Parses The String For Variables vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers va_end(ap); // Results Are Stored In Text glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits glListBase(listbase); // Sets The Base Character to 0 if (sizescale!=1.0f) glScalef(sizescale,sizescale,sizescale); glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws The Display List Text if (sizescale!=1.0f) glScalef(1.0f/sizescale,1.0f/sizescale,1.0f/sizescale); glPopAttrib(); // Pops The Display List Bits }
// print the text void font_print(float x, float y, const char *text, SDL_Color *color) { int i; // save state glPushMatrix(); glPushAttrib(GL_CURRENT_BIT); // color // set the color of the font (if color is not NULL) if (color != NULL) { glColor4f(color->r/255, color->g/255, color->b/255, 1.0f); } else { // otherwise, plain white glColor4f(1.0f, 1.0f, 1.0f, 1.0f); } glBlendFunc(GL_ONE, GL_ONE); glEnable(GL_BLEND); // enable and bind the font texture glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, font_texture->id); glLoadIdentity(); glTranslatef(x, y, 0.0f); // set starting point of display list glListBase(font_base-32); for (i = 0; i < strlen(text); i++ ) { glCallLists(font_base, GL_UNSIGNED_BYTE, text+i); } // go back to how we were glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glPopAttrib(); // Color glPopMatrix(); }
GLvoid NEHE17::glPrint(GLint x, GLint y, const char *string, int set){ if(set > 1){ set = 1; } glBindTexture(GL_TEXTURE_2D, texture[0]); glDisable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(0,640,0,480,-100,100); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glTranslated(x,y,0); // translate to right position on screen glListBase(base-32+(128*set)); glCallLists((int)(strlen(string)),GL_BYTE,string); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); glEnable(GL_DEPTH_TEST); }