PDA

View Full Version : wglUseFontOutlines failure on W2K



JoeFinn
03-14-2003, 11:43 PM
Hello,

I am getting a failure when attempting to call wglUseFontOutlines on W2K. I read on MSDN that this is a documented problem with NT and that you must use wglUseFontOutlines AND wglUseFontBitmaps (not really sure what the "AND" means).

I have searched the FAQ's and I can't find any info on how to deal with this limitation when using a double buffered window (assuming W2K has the same limitations as NT). I want to have text that translates and rotates with the model.

The compiler that I am using is Borland Builder v5.0.

Any help greatly appreciated.

Thanks in advance,

Joe

mikael_aronsson
03-15-2003, 08:09 AM
Hi !

I think your problems has to do with something else, I have used wglUseFontOutlines on both NT, Windows2000 and XP without problems.

Mikael

shinpaughp
03-15-2003, 08:25 AM
Did you cal glGenTextures prior to wglGetFontOutlines?

JoeFinn
03-15-2003, 09:45 AM
No, I don't do a call to glGenTextures. I do a call to CreateFont then wglUseFontOutlines. The examples on NEHE don't use a call to glGenTextures. The code works fine on windows 98 but on W2K the call to wglUseFontOutlines fails.

shinpaughp
03-15-2003, 10:28 AM
Sorry. I used it long ago but haven't had a need in quite some time. Let me relook at it. I'll get back to you.

shinpaughp
03-15-2003, 10:48 AM
Okay, I just tried some things. Anyway, try this and see if it works. Did you select the font before calling wglUseFontOutlines? Enough storage for all characters in GLYPHMETRICSFLOAT, and if it still doesn't work, try changing some of the values for the font you created especially precisions and quality, etc.




GLYPHMETRICSFLOAT agmf[256];
HFONT fontol = CreateFont(20, 15, 0, 0, FW_DONTCARE, 0, 0, 0, ANSI_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | | FF_ROMAN, "Arial");
SelectObject(m_hdc, fontol);
BOOL font = wglUseFontOutlines(m_hdc, 0, 255, 1000, 0.0f, 0.1f, WGL_FONT_POLYGONS, agmf);
if (!font)
DoWinError();
glListBase(1000);
glTranslatef(0.0, 0.0, -5.0);
glCallLists(24, GL_UNSIGNED_BYTE, "Hello Win32 OpenGL World.");



Hope it helps.