Sign in to follow this  

[.net] C# and the Tao Framework

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

I posted earlier asking about C# books. I just downloaded the Tao framework and... well, I have no idea how to use it at all! I want to try my hand at libraries like OpenGL and SDL with the .NET framework and C#. Can anyone point me to some tutorials to get me started? I've found a few, but they're written in Visual Basic. Thanks in advance!

Share this post


Link to post
Share on other sites
Check out the Tao-NeHe tutorials in the Tao repository. You should also be able to find examples with each of the other libraries.

If you're not familiar with OpenGL at all, I would recommend reading the original NeHe tutorials while walking through the Tao examples.

I hope that helps, at least for the OpenGL part. I'm not familiar with SDL. :(
HTH

Share this post


Link to post
Share on other sites
As you probably already know, the Tao Framework provides hard .NET bindings to libraries like OpenGL and SDL. If you're planning on using SDL with C#, I'd strongly recommend you take a look at SDL.NET as it provides a layer ontop of that hard .NET binding making it object oriented and managed. It's very easy to use OpenGL (via Tao.OpenGl) through SDL.NET as it provides a large amount of functionality through the SdlDotNet.Video class. There are also the SDL.NET NeHe lessons which translate the NeHe tutorials to C# and take advantage of SDL.NET's goodness.

A new feature coming in SDL.NET 4.0.1 is the ability to change OpenGL attributes by using properties instead of using a function call. There was also a bug that occured when using the event ticker with OpenGL that's fixed in 4.0.1. It's planned to release sometime next week. Check out the changelog.

But of course, you don't need to take the SDL.NET route. You could use Tao.Sdl directly with Tao.OpenGl, making it exactly like programming with the straight APIs, but in C#. You could even use Tao.Glfw (GLFW) instead of Tao.Sdl for the window management and input handling. In my opinion though, SDL.NET and Tao.OpenGl is the easiest way to go when it comes to C# and OpenGL. SDL.NET's NeHe Lesson 1 goes over basic OpenGL window creation using SDL.NET. Check out the source and I'm sure you'll understand what's going on.

Share this post


Link to post
Share on other sites
I downloaded and installed SDL.NET and took a look at some of the NeHe tutorials, but I'm having trouble.

None of the classes in the tutorials seem to have a Main() method. Are these classes meant to be used as members of another class? If not, what should the Main() method do to get them to work properly. Just for the heck of it, I defined a Main() method in the NeHe001 class and had it call Run(). This seemed to work initially, but the program doesn't exit properly and seems to flicker.

How are these classes supposed to be used?

Share this post


Link to post
Share on other sites
With SDL.NET the NeHe tutorials are run through their own project. This means that there is a main project interface that loads up all the NeHe examples that were compiled, displays them in a list box and asks you which one you want to run.



This was done to just make life easier on the user and us. In order to run the demos you're going to have to download SDL.NET and open up the NeHe project file. As for the flickering, this is because you're using the event ticker with OpenGL. This problem is fixed in SDL.NET 4.0.1 and will be out sometime next week. 4.0.1 will probably also fix the problem about the window not being closed properly. I'd strongly recommend you use the NeHe project instead of the individual classes though, as it's much easier to use and switch between the NeHe demos. But you'll have to wait for 4.0.1 for that flickering to stop [wink].

Share this post


Link to post
Share on other sites

This topic is 4388 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this