• Advertisement
Sign in to follow this  

[.net] Bitmap Fonts

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

How can I display OpenGL bitmap fonts when using Tao C#. Looking at the NeHe Tuts, they use the SelectObject function to associate the font with the device context, what would be the C# equivelant?

Share this post


Link to post
Share on other sites
Advertisement
Well, if you want to do it the way shown in the tutorial, you will need to add the pinvoke methods to your class, see: PInvoke. You can use the System.Drawing.Font class to create the font, then call the ToHfont method. The IntPtr returned from that can be passed to SelectObject, and from there to your wgl call.

On that note, i'm trying to get onto tha Tao site, but it's not letting me, so I can't tell you how to do it using the Tao framework. As soon as i can access said site, I will give you an answer :P

Share this post


Link to post
Share on other sites
Ok, just got this up and running. ToHFont was just what I needed =). Is there any way I can find the size of a printed string in the OpenGL window, perhaps a function that will give me the pixel width of a string printed in a particular font that I could divide by the window's width?

Share this post


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

  • Advertisement