[.net] Bitmap Fonts

Started by
1 comment, last by Lithic 19 years, 9 months ago
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?
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

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

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?

This topic is closed to new replies.

Advertisement