Jump to content
  • Advertisement
Sign in to follow this  
namingway

opengl in C#

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

Just wondering is there a better alternative to getting opengl in C#? I'm currently using tao and its simpleglcontrol doesn't update when i resize the window... Prefereably after something with that comes with a form control. -regards Namingway

Share this post


Link to post
Share on other sites
Advertisement
You could try OpenTK. I've never used it, so I have no idea what to expect from it...but it'd be hard to be worse than Tao.

Share this post


Link to post
Share on other sites
Quote:
Original post by Promit
You could try OpenTK. I've never used it, so I have no idea what to expect from it...but it'd be hard to be worse than Tao.


What's wrong with Tao? I've got no personal attachment to it. I'm just curious if you know something I don't.

Share this post


Link to post
Share on other sites
I believe Tao also wraps GLFW and SDL libraries. These are cross-platform libraries for creating OpenGL contexts. I find GLFW to be leaner, simpler, and more powerful than SDL for just OpenGL work, but SDL has additional functionality for things such as sound and networking.

Share this post


Link to post
Share on other sites
Quote:
Original post by smr
Quote:
Original post by Promit
You could try OpenTK. I've never used it, so I have no idea what to expect from it...but it'd be hard to be worse than Tao.


What's wrong with Tao? I've got no personal attachment to it. I'm just curious if you know something I don't.
It's just as absolutely simple and opaque an interface to OGL as could possibly be written. It makes no particular attempt to help you or convert anything to make sense in a managed context. It does what it says it will do, it just does it in such a dense way that it's annoying.

Share this post


Link to post
Share on other sites
Quote:
Original post by Promit
You could try OpenTK. I've never used it, so I have no idea what to expect from it...but it'd be hard to be worse than Tao.


This is actually what I've been looking for but I'd forgotten the name, thanks.

Share this post


Link to post
Share on other sites
Even though an alternative has been already provided, the missing update is not an issue of Tao, that's how updates are being handled by Windows Forms.
All you need to do is call Refresh on the control to let the application know that it needs to be updated.

Share this post


Link to post
Share on other sites
Here's how I handle resize events :

"Resize" Event for GlTilesControl (SimpleOpenGLControl):

private void GlTilesControl_Resize(object sender, EventArgs e)
{
GlTilesControl.MakeCurrent(); // Just in case You have several OpenGL controls, but it is not obliged...

Gl.glViewport(0, 0, GlTilesControl.Width, GlTilesControl.Height);
Gl.glMatrixMode(Gl.GL_PROJECTION);
Gl.glLoadIdentity();
Gl.glOrtho(GlTilesControl.Left, GlTilesControl.Width, GlTilesControl.Height, GlTilesControl.Top, -1, 1);
Gl.glMatrixMode(Gl.GL_MODELVIEW);
Gl.glLoadIdentity();

}





(Edit : It setups the render for a 2D mode !)

[Edited by - iliak on June 14, 2008 4:40:26 AM]

Share this post


Link to post
Share on other sites
Another question, what are some good image libraries that will work with C# and opengl? I use freeimage in C++ and opengl, but its not supported with .net. I noticed Tao has DevIL would it work with opentk?

-thanks for the replies :D

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!