Sign in to follow this  

Example for C# + Tao OpenGL ?

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

Are there any examples for tao opengl in c#??? the moss basic things, like loading texture, blending or so. have found a few on the net, but are very bad documented. or are there any books on this topic? thanx

Share this post


Link to post
Share on other sites
Like in MickDuprez's post, take a look at the Tao Framework's Spinning Triangle on the Wiki. Aside from that, have a look at the examples that are provided when you download the framework.

The good thing about the Tao Framework is that it follows the underlaying libraries almost directly. This means that you can follow a C++ tutorial and just copy and paste the code, putting a "Gl." or a "Glu." before any OpenGL calls.

Share this post


Link to post
Share on other sites
thanx, i tried the triangle example:
and copied the following lines into my little
program:

Il.ilInit();
Ilut.ilutInit();
Ilut.ilutGLLoadImage("test.jpg");

but just did not work. i am confused the
spinning triangle does not use opengl
commands like:
glBindTexture(GL_TEXTURE_2D, texture);

but those 3 lines seems to be all is needed
for loading a texture in tao.

any idea what could be wrong?

thanx.

P.S. ever used c++ before, thats why have all
the problems. :(

Share this post


Link to post
Share on other sites
You're right, glBindTexture isn't called. I think it still works because DevIL might call it for you..... You could try something like this:


int tex;

void Init()
{
Il.ilInit();
Ilu.iluInit();
Ilut.ilutInit();
}
void LoadTexture()
{
tex = Ilut.ilutGLLoadImage("test.jpg");
Gl.glBindTexture(Gl.GL_TEXTURE_2D, tex);
}



Call Init, followed by LoadTexture. Be sure you're drawing code is correct...

Share this post


Link to post
Share on other sites
Quote:
Original post by sitwind
btw
Ilut.ilutGLLoadImage("test.jpg");
returns a boolen value, not int
I think that was a typo in the latest release of Tao.DevIL. The fix is in the SVN and will be out in the next release. You could easily just checkout the repository and then build Tao.DevIL with the fix. It has also been updated to the latest version of DevIL since then.

Share this post


Link to post
Share on other sites

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