Skip to main content
gamedev.net
🔒 Locked

HDC question ...

Started by Codorke Mar 11, 2005 at 10:31 AM 0 replies 350+ views
Original Post
Codorke
Codorke
Hi, I want to make a class that can print bitmap fonts to the openGL window screen. But i need acces to the HDC hDC var and i don't know how to reach it. Program.cpp |_calls cOpenGL() ..........|_ controls the hDC, hRC and hWnd vars. |_calls cRender() ....|_ calls my cBitmapFonts in the drawScene(). ...................|_ needs HDC hDC. Can someone help me with this probl ?
kburkhart84
kburkhart84
If you are using windows(I should assume) I don't know if other OS use HDC, but the function is a "wiggle" function.
wglGetCurrentDC();
Just say, HDC myhDC=wglGetCurrentDC();
Then use this same myhDC for all the font loading, etc... This HDC will be the same one you used in your init, but I understand not wanting to pass that as a parameter everywhere.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.