glCallLists positioning problem

Started by
1 comment, last by Schaschlik 20 years, 6 months ago
Hi everyone! I have a problem regarding OpenGL and MFC. I use bitmap fonts to draw text in a OpenGL view (MFC doc/view interface). The following code creates the display lists: m_pDC->SelectObject( GetStockObject(SYSTEM_FONT) ); wglUseFontBitmaps (m_pDC->GetSafeHdc(), 0, 255, 0); The following code draws the text: glLoadIdentity(); glTranslatef( 0.0f, 0.0f, 0.0f ); glCallLists( string.GetLength(), GL_UNSIGNED_BYTE, (LPCTSTR)string ); Thing is, neither the glLoadIdentity() statement nor the glTranslatef() call has any effect; the text is initially drawn always at the same point of the view. If the text changes, the new string begins at the point where the old string ended. If you have any idea how to solve this problem, please tell me! Many thanks in advance Timor
Advertisement
It sounds as if you aren''t setting the raster position properly before drawing your text. Download this document by Mark Kilgard, and look for the section entitled ''Careful Updating that Raster Position''.
Many thanks, it works!

This topic is closed to new replies.

Advertisement