Example for C# + Tao OpenGL ?

Started by
5 comments, last by Rob Loach 17 years, 6 months ago
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
Advertisement
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.
Rob Loach [Website] [Projects] [Contact]
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. :(
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...
Rob Loach [Website] [Projects] [Contact]
works now, thanx Rob Loach !
btw
Ilut.ilutGLLoadImage("test.jpg");
returns a boolen value, not int
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.
Rob Loach [Website] [Projects] [Contact]

This topic is closed to new replies.

Advertisement