   Fonts
  I''ve read the tutorials on both bitmap and outline fonts, implemented the code into my programs, checked it over about a thousand times, and it still doesn''t work!  /* CreateBitmapFont:Registers and creates a font for use in OpenGL*/unsigned int nCreateBitmapFont(char *fontName, int fontSize){HFONT hFont;    // windows fontunsigned int base = glGenLists(96);if (base == 0)MessageBox(NULL, "Base failed at creating lists for storage.", "Failure", MB_OK);if (stricmp(fontName, "symbol") == 0){ hFont = CreateFont(fontSize, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,FF_DONTCARE | DEFAULT_PITCH, fontName);}else{ hFont = CreateFont(fontSize, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,FF_DONTCARE | DEFAULT_PITCH, fontName);}if (!hFont){MessageBox(NULL, "Hfont failed in creation." , "Failure", MB_OK);return 0;}SelectObject(g_HDC, hFont);wglUseFontBitmaps(g_HDC, 32, 96, base);return base;}/* PrintString:Displays a string using the returned base from the above function*/void nPrintString(unsigned int base, char *str, float x, float y){glRasterPos2f(x, y);if ((base == 0) || (str == NULL))return;glPushAttrib(GL_LIST_BIT);glListBase(base - 32);glCallLists(strlen(str), GL_UNSIGNED_BYTE, str);glPopAttrib();}/* ClearFont:Clean up for font stuff*/void nClearFont(unsigned int base){if (base != 0)glDeleteLists(base, 96);}[END CODE]As you can probably see, that code is pretty much copied and pasted right out of the tutorial (with a little error checking added by me).  I have no errors creating fonts (at least ones that cause crashes), but when I run the program, no text messages show up when I send the nPrintString function!  After I added some of the MessageBox() checking code, I realized font creating is failing at base == glGenLists(96);.  The variable base = 0.  I don''t know why this is happening; I seem to be using all the right code?  Any help?  Sorry if this is kind of a newbie question .   
  becareful, i know that the methods used for doing this in win9x and winNT/2k/xp are different and wont work on the opposite without crashing  Dustin DavisOwner / CEOProgrammers Unlimitedwww.Programmers-Unlimited.com;  ?  I am using windows 98.  ;  I added some code that checks the variable base by using glIsList() to check whether it''s a valid display list or not, and it''s returning false.  Why should the base variable return false? ;quote:Original post by titan2782  becareful, i know that the methods used for doing this in win9x and winNT/2k/xp are different and wont work on the opposite without crashing  Dustin DavisOwner / CEOProgrammers Unlimitedwww.Programmers-Unlimited.com I am using XP and both the bitmap and outline font tuts work fine. ;  That''s good and all , but why isn''t my base variable working?  I see no problem with it.  glIsList is returning false when I check it. ;  There''s one thing I can''t understand:the base variable is decleared in the fuction nCreateBitmapFont(); what variable are you passing then as an argument in nPrintString(unsigned int base, char *str, float x, float y)?I mean, how can you call that function without knowing which value was assigned to base?Maybe it''s just me who can''t get it ;  Post the code where you load the font, the error is in there i think.By the way, why don''t you reassign the old font and delete the new one? I am not sure this is required but nehe does so. ;quote:Original post by lazork357  There''s one thing I can''t understand:the base variable is decleared in the fuction nCreateBitmapFont(); what variable are you passing then as an argument in nPrintString(unsigned int base, char *str, float x, float y)?I mean, how can you call that function without knowing which value was assigned to base?Maybe it''s just me who can''t get it   The base value is returned by nCreateBitmapFont and probably (i hope so for Videege ) stored in another variable. ;  Of course, I declare fonts in this fashion:unsigned int my_font = nCreateBitmapFont("Times New Roman", 12);And then I display them like this:nPrintString(my_font, "Yep.", 0.0f, 0.0f);I originally had this all in a class so it was slightly more managable, but I took it out on the offchance that it was causing an error.  The glGenLists() is going wrong, I''m getting errors there. 