Jump to content
  • Advertisement
Sign in to follow this  
Errant Knight

[.net] Loading font for OpenGL

This topic is 4641 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

I need to load a font and render text using OpenGL. (I'm using TAO libarary if it makes any difference) Basically what I need is just to convert the following function from C++ to C# This function from NeHe's OpenGL tutorials on how to do the thing in C++ and WinAPI: GLvoid BuildFont(GLvoid) { HFONT font, oldfont; base = glGenLists(96); font = CreateFont(*params cut out*); oldfont = (HFONT)SelectObject(hDC, font); // Selects The Font We Want wglUseFontBitmaps(hDC, 32, 96, base); // Builds 96 Characters Starting At Character 32 SelectObject(hDC, oldfont); // Selects The Font We Want DeleteObject(font); // Delete The Font } // Now the C# conversion I'm working on: void BuildFont() { int listID = Gl.glGenLists(96); // Create the font System.Drawing.Font font = new System.Drawing.Font("Arial", 22); // *what to do now?* Tao.Platform.Windows.Wgl.wglUseFontBitmaps(*?*, 32, 96, listID); // *and again* }

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!