Jump to content
  • Advertisement
Sign in to follow this  
sverrho

OpenGL OpenGL, Glut and C#...

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

Hi I currently working on a C#-project, and need some graphics. I have implemented OpenGL, and it works ok, but I am missing some functionality like drawing text. Therefore it would be great to use glut, combined with common openGL-functions (like glBegin(), glEnd(), ...) in a GUI designed with visual C#.NET. Bottom line: I am curently using openGL in a panel (SimpleOpenGLControl from the TAO-project), but want to add some of the functions in Glut (like Glut.glutSolidTorus). Is this possible? If so... How? Thanks for all replys :) Sverre

Share this post


Link to post
Share on other sites
Advertisement
FreeGLUT actually has the text drawing functionality built into it. Take a look at the One Example in the Tao SVN for a demonstration of it being used.

Another solution, the one taken with BooGame, was to create a bitmap font using System.Drawing and then load it into an OpenGL texture using Tao.DevIL. If you take a look at Font.cs, you'll see the Load function that takes in a System.Drawing.Font...

Share this post


Link to post
Share on other sites
soconne: I have seen this exsample before, and it looks great. Yes, it does exactly what I want, with only one exception. It creates the window using glut. I want to create a SimpleOpenGLControl (the one from Tao), and use glut in the drawing method, although I still will be using the regular openGL functions.

I have used openGL before, but I am totally new in Glut, so I don't even know if this is possible. I know some packages replases openGL, and if Glut is like them, I don't want to use it.

Thanks for your help :)

Share this post


Link to post
Share on other sites
Okay.... I have found my problem.

I tried to just initialize glut, and use it in the paint-method for opengl, but then the whole program crashed when it was drawn. It seems like the reason for this is that I was using glutSwapBuffers at the end. If I remove this, it all works fine. Why is that? Isn't glutSwapBuffers supposed to swap the doublebuffer to screen? Why is anything drawn at all when this doesn't run?

Edit: And what do I have to do to be able to use glutSwapBuffers. (Is it even nessesary?)

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!