Archived

This topic is now archived and is closed to further replies.

What Bombs wglUseFontBitmaps?

This topic is 5979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

What sorts of things can cause this function to fail? I'm pulling my hair out wondering why it comes up with invalid parameter error (87 on GetLastError()) and can't figure out what the problem is. I've made sure the GDI object is selected properly by doing a debug TextOut() call, and it shows up properly with the right attributes. My display lists are created appropriately. I don't know what the problem is. Here's the code in question:
 ` void CreateFonts() { HFONT TempFont; char Temp[40]; FontDisplayLists=new uint[NUM_FONTS]; TempFont=CreateFont(64, 16, 0, 0, FW_BOLD, 0, 0, 0, \ ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "tahoma"); SelectObject(MainHDC, TempFont); for(ushort n=0; n
Simply put, the if statement in there evaluates to true and the error code 87 is spat out, which according to MSDN is an invalid parameter error. Zwah...? None of the supposedly created display lists work, either, not surprisingly. NUM_FONTS, FONT_DEFAULT are both #defined in the header file associated with this source file, and are the proper values of 1 and 0, respectively. MainHDC is the handle to the DC of the main window (which also houses the main HGLRC) and is initialized properly. FontDisplayLists is an unsigned integer pointer set to NULL initially, then initialized by this function, and later deleted by a cooresponding DeleteFonts() function. If nothing here looks entirely out of order... I've read of other people having similar problems, but haven't gleaned any form of a solution suggestion. Talk about disappointing... Oh well, any input would be appreciated. Edited by - Omaha on January 12, 2002 2:52:57 AM

Share on other sites
I adapted your code to a GL project of mine and it worked fine, are you sure everything is set up and is being created properly?

Sorry I couldn''t be of more help...

---
No game will ever rule more than CBT!

Share on other sites
Drat! Well, I guess I'll have to look elsewhere. I appreciate the response. No "How very odd..." message box popped up for you?

You made a call, later, to (or something functionally equivelent) glCallList(FontDisplayLists[FONT_DEFAULT]+insert_character_index_here) I'll assume?

I will look through other parts of my code related to initialization and whatnot. I have no idea what the problem could be though.

Thanks again!

Edited by - Omaha on January 12, 2002 9:59:33 AM

Share on other sites
For some reason the first call I make to wglUseFontBitmaps always fails. Weird. I worked around it by having one dummy call before any important ones.

• 10
• 17
• 9
• 14
• 41