Tao Framework - Documentation/Examples on extensions

Started by
5 comments, last by Anders_Hjorth 18 years, 5 months ago
I'm looking for Documentation or examples on using OpenGL extensions within Tao, specifically I'm trying to create a pBuffer. I've gone through the 'normal' routine of converting OpenGL code to Tao code (Which is basically just adding a lot of "Gl." and "Wgl."...) but this doesn't do the trick with pBuffers. One problem is that the ContextGL class doesn't seem to support wgl functions. On a more general note; does anyone have a good source of documentation on the specifics in the Tao framework? It's a good framework, but not a lot of help floating around on it's usage. (I'm using Tao 1.2.0 and VS2005 .NET 2.0 C#)
Advertisement
That's precisely the thing I dislike about the Tao Framework, the lack of communication ability between members. I've pushed and pushed for an official forum for the matter, but noone seems to either want to make one, or have the ability to make one that's officially in association with Mono (since Tao is a branch off Mono). The only way to communicate with the mass of Tao users is the Tao Mailing List. I suggest you post your problem on there as Vlad will likely see it himself.
Rob Loach [Website] [Projects] [Contact]
Yes, my sentiments exactly! The Tao framework deserves a better forum than the current Mailinglist...
You should probably better use the framebuffer object extension instead of pBuffers anyway. Wgl is not crossplatform and that defeats the purpose of OpenGL IMHO. I think Nvidia and ATI already support the extension well enough with their newest drivers. I have it even running on my mobility radeon 9600.

Now to the extensions:

In contrast to the previous versions of Tao.OpenGL you now have to load the extensions with the Extensionloader class. Just call GlExtensionLoader.LoadAllExtensions() at intialisation time and all available extension are loaded. You can also load them one at a time with LoadExtension(string) and check for availability with IsExtensionSupported(string).

I also agree on the need for a forum. A Tao forum at gamedev.net would be nice. ;)
Firstly, You mention frame buffer objects... They were my first choice, but unfortunately I'm developing something that needs to run on several older computers, and they don't support the promised land that is frame buffer objects.. ;-)

I've already tried loading the extensions through LoadAll... I must be doing something else wrong though. What I'm doing is:


public IntPtr wglCreatePbufferARB;
...
wglCreatePbufferARB = GlExtensionLoader.GetProcAddress("wglCreatePbufferARB");
...
cgl = new ContextGl();
GlExtensionLoader.LoadAllExtensions(cgl);
...
hPbuffer = Wgl.wglCreatePbufferARB(wglCreatePbufferARB, hDC, pixelFormat[0], width, height, pbuffer_attr);


Two things bother me here. Firstly I stumbled on what must be the only document in history describing some of the Tao specifics, and it said to use the ContextGL class if several contexts was to be used. My prob.: how to "use" it? no info available here...

Secondly, when I invoke my Wgl extension functions the first param. it requires is an "IntPtr extensionPtr", this is not OpenGL, and Tao fails to comment on it... I'm simply using the procaddress, and the call returns, but a procaddress is hardly an extension pointer, so I can'd be sure that this is not where I've done wrong.

(I think were actually well on our way to having created the largest online Tao forum right here... ;-)
I have never used the wgl extensions with Tao. I don`t even know if they are supported in the current version. But the extension pointer use looks right. In the last version of Tao i had used extension that worked like this(glGenBuffers as example):

IntPtr glGenBuffersARB = Glfw.glfwGetProcAddress("glGenBuffersARB"); // I used GLFW here but it is just a wrapper that calls wglGetProcAdress on windowsGl.glGenBuffersARB(glGenBuffersARB, vertexBufferIds.Count, vertexBufferIds.innerArray); // the extension pointer is actually the procadress I believe.


You may have a problem with multiple opengl contexts. I vaguely remember something like that extensions are always bound to the current context(I could be wrong though). Try to call getProcAdress() after the creation of the context. Also try to load the extension with LoadExtension and check with IsExtensionSupported. Maybe LoadAllExtensions() does just load the normal gl- but not wgl-extensions and you have to do that manually. And if that does not help, try to use the OpenGLExtensionImport class(it seems to be an obsolete class(supposed to be private?) but who knows).

I just generated the documentation for the Tao.OpenGl dll with ndoc(took about 1.5 hours on a P4 3Ghz and resulted in over 100 mb of html!) but I found no wgl or pbuffer function in it. So you may be out of luck with the current version. But the documentation for contextgl was interesting. It seems as if you have to call GL commands directly from the contextgl instance(or in the static case from contextgl) like this:
ContexGl cgl = new ContextGl();// static callsContexGl.glBegin();ContextGl.glVertex3f(..);...ContextGl.glEnd();// member callscgl.glCreateProgram(..)cgl.glCreateShader(..)etc..



Most of the tips I gave you are speculation as I don`t know much about Tao myself. The (not auto-generated) documentation is very small.
Thanks, I really appreciate Your effort!

I also noticed the peculiar fact about the ContextGl class, and I tried using the instance members to render within the pBuffer context, but no dice here either. It seems as though the static members of ContextGL are the 'standard' GL stuff, and the instance contains everything related to extensions... but sadly none of the Wgl extensions! I find it weird that no non-autogenerated docs exist on this topic, I mean it's pretty crucial to anyone wanting to exploit the capabilities of extensions in Tao... And multiple context are neccesary for many applications if I'm not mistaken?

Anyways, thanks for your advice Xanthos... I'll venture forth in my exhaustive trial-and-error search of the correct combination of Tao commands that will unlock the secret of pBuffers... ;-)

This topic is closed to new replies.

Advertisement