• Advertisement

Archived

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

HDC question

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all, I got a little problem here with the manipulation of the HDC. Searching the net I found that a standard HDC is a pointer to a context, not the context itself. I''m constructing a small font class and i need the HDC for the constructor. So I''m passing a HDC when I create the object but my object doesn''t render when I call the print() function. The program compile fine, but the text just wont appear. My guess is that I dont use the HDC correctly, and I''d like to have your opinion wether or not the following code manipulate the HDC ok. //This is the creator of the class CFont::CFont(HDC hDC, int size) { base = glGenLists(256); font = CreateFont(-size,0,0,0,FW_BOLD,FALSE,FALSE,FALSE, ANSI_CHARSET,OUT_TT_PRECIS,CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,FF_DONTCARE|DEFAULT_PITCH,"Comic Sans MS"); SelectObject(hDC, font); wglUseFontOutlines(hDC,0,255,base,0.0f,0.2f, WGL_FONT_POLYGONS,gmf); } //This is how I create my object CFont font((world.GetHdc()), 24); //The GetHdc returns the current HDC I then call font.Print(); , which hold the same things as in the tutorial 14 glPrint() Thx for ur help! Kiroke www.geocities.com/kiroke2

Share this post


Link to post
Share on other sites
Advertisement
Dont bother respond the question : I just found the answer. I hate it when u post a question and find out the answer just after, even if u searched alot be4 :-(



Kiroke
www.geocities.com/kiroke2

Share this post


Link to post
Share on other sites

  • Advertisement