Hi all,
im trying to implement bitmap fonts from NeHe tutorial 17 into my program and i''m using basically the same code, when i try and print it to screen it comes up as a white box where the text should be! just like if textures werent enabled or somthing (which they are

).
i cant seem to find what is going wrong! i''d hoped someone else mite be able to see something that i am missing!
here is the code im using to build the font from a texture (which is stored in a texture class i created, which works fine) and then to render the font to the screen.
bool BitmapFont::BuildFromFile(char *filename)
{
float cx; // Holds Our X Character Coord
float cy; // Holds Our Y Character Coord
GLuint loop;
base=glGenLists(256); // Creating 256 Display Lists
//glBindTexture(GL_TEXTURE_2D, texture[0]); // Select Our Font Texture
font.UseBMPTexture(1);
for (loop=0; loop<256; loop++) // Loop Through All 256 Lists
{
cx=float(loop%16)/16.0f; // X Position Of Current Character
cy=float(loop/16)/16.0f; // Y Position Of Current Character
glNewList(base+loop,GL_COMPILE); // Start Building A List
glBegin(GL_QUADS); // Use A Quad For Each Character
glTexCoord2f(cx,1-cy-0.0625f); // Texture Coord (Bottom Left)
glVertex2i(0,0); // Vertex Coord (Bottom Left)
glTexCoord2f(cx+0.0625f,1-cy-0.0625f); // Texture Coord (Bottom Right)
glVertex2i(16,0); // Vertex Coord (Bottom Right)
glTexCoord2f(cx+0.0625f,1-cy); // Texture Coord (Top Right)
glVertex2i(16,16); // Vertex Coord (Top Right)
glTexCoord2f(cx,1-cy); // Texture Coord (Top Left)
glVertex2i(0,16); // Vertex Coord (Top Left)
glEnd(); // Done Building Our Quad (Character)
glTranslated(10,0,0); // Move To The Right Of The Character
glEndList(); // Done Building The Display List
}
return true;
}
GLvoid BitmapFont::Print(GLint x, GLint y, int set, const char *fmt, ...)
{
char text[256]; //holds the string
va_list ap; //pointer to list of arguments
if (fmt == NULL) //if theres no text
return;
va_start(ap, fmt); //parses the string for variables
vsprintf(text, fmt, ap); //converts symbols to actual numbers
va_end(ap); //restuls are stored in text
if (set>1) //did user choose an invalid character set?
{
set = 1;
}
glEnable(GL_TEXTURE_2D);
glLoadIdentity();
glTranslated(x,y,0); //position the text (0,0) = bottom left
glListBase(base-32+(128*set)); //choose the font set 1 or 0
if (set==0) //if set 0 is being used then enlarge the font
{
glScalef(1.5f,2.0f,1.0f);
}
glCallLists(strlen(text),GL_UNSIGNED_BYTE, text); //write the text to the screen
glDisable(GL_TEXTURE_2D);
}
if anyone could help that would be great.
sorry if this is kinda long :S