Hi,
I'm using
TexFont (which is a C Texture mapped font library) to render text in my 3D engine.
I have it compiling and running but all my text just comes out as blocks:
Heres my font set up:
bool Visitor::setUpFonts() {
bool success = true;
ptrFont = txfLoadFont("data/fonts/default.txf");
if ( ptrFont == NULL )
success = false;
else
txfEstablishTexture( ptrFont, 0, GL_FALSE );
return success;
}
Heres my font printing function:
void Visitor::visit( Text2DNode* ptrText2DNode ) {
string strText = dynamic_cast<Text2D*>(ptrText2DNode->getResource())->getString();
char *ptrcText = const_cast<char*>( strText.c_str() );
Logger l;
l.quickLog("Text2D.txt", strText);
OpenMode2D();
glAlphaFunc(GL_GEQUAL, 0.0625);
glEnable(GL_ALPHA_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPushMatrix();
glEnable( GL_TEXTURE_2D );
glMatrixMode(GL_MODELVIEW);
glTranslated( 100.0, 80.0, 0.0 );
glColor3d( 1.0, 0.0, 0.0 );
txfRenderString( ptrFont, ptrcText, strlen(ptrcText) );
glPopMatrix();
glDisable(GL_BLEND);
CloseMode2D();
}
Now in the txfLoadFont() function i did go in and change:
Quote:
#if 1
/* XXX Indigo2 IMPACT in IRIX 5.3 and 6.2 does not support the GL_INTENSITY
internal texture format. Sigh. Win32 non-GLX users should disable this
code. */
if (useLuminanceAlpha == 0) {
to:
Quote:
#if 0
Which took care of a crash problem when rendering text.
Also PolygonOffset is off.
I am rendering the text in orthographic mode.
So any ideas why it's readning all screwed up?