Displaying Text with CSGL

  • Thread starter Thread starter Stu
  • Start date Start date
S

Stu

I am working with C# in a .NET environment and I have written an
application using csgl. I need to display text on
the output viewport. I am displaying things with a
CsGL.OpenGL.OpenGLControl but I can't figure out how to put text on
there.

The standard OpenGL solution
relies on the wglUseFontBitmaps() api to create the display
lists. CSGL doesn't have a comparable function that I can find.

I have tried using CSGL.GDITextureFont to create the display lists but
they do not display correctly. Every character that I try to display
comes out with a solid box. This is the code that I tried:


using GL=CsGL.OpenGL.GL;
using CSGL=CsGL.OpenGL;
...
Font newFont;
CSGL.GDITextureFont myGDITextureFont;
newFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
myGDITextureFont = new CsGL.OpenGL.GDITextureFont(newFont, 'a',
'z');
GL.glColor3f(0, 1.0f, 0);
myGDITextureFont.Draw2DString("here you go !", 50, 50);

If anyone can help with specifics of how to do this with csgl, it
would be *greatly* appreciated.


You can mail me directly at (e-mail address removed) if you have any
examples.
 
Back
Top