Sign in to follow this  
Lithic

[.net] ARB extensions in Tao

Recommended Posts

Lithic    345
I am using the Tao OpenGL wrapper for my C# openGL window. I want to load up a couple ARB extensions so that I can use a pbuffer, but this:
IntPtr hdc = User.GetDC(Handle);
IntPtr ext = Wgl.wglGetProcAddress("wglGetExtensionsStringARB");
string extString = Wgl.wglGetExtensionsStringARB(ext, hdc);
doesn't work for some reason. After ext is assigned, it is still equal to zero. Why is that? Am I doing this wrong?

Share this post


Link to post
Share on other sites
Washu    7829
Hrm, I'm not sure Lithic, i checked your extension string, and it matches whats in the OpenGL Extension Registry...so, i don't see any reason why it shouldn't return it.

Share this post


Link to post
Share on other sites
Xanthos    168
From the GDnet article "Moving Beyond OpenGL 1.1 for Windows":

Quote:
As the ARB suffix indicates, it's an extension itself (ARB_extensions_string), so you'll have to get the address of it yourself using wglGetProcAddress(). Note that for some reason, some ICDs identify this as wglGetExtensionsStringEXT() instead, so if you fail to get a pointer to one, try the other.


That may be your problem.

Another cause could be that you don`t have the current context.
But wglMakeCurrent might already be called by User.GetDC(Handle).

Share this post


Link to post
Share on other sites
Lithic    345
Ok. Modified the code to reflect on your posts (still doesn't work).

bool ARB = true;
IntPtr ext = Wgl.wglGetProcAddress("wglGetExtensionsStringARB");
if (ext.Equals(new IntPtr([0]))) // Brackets around [0] are a fault of the C# gamedev source script
ext = Wgl.wglGetProcAddress("wglGetExtensionsStringEXT");
string extString = ARB ? Wgl.wglGetExtensionsStringARB(ext, hdc) : Wgl.wglGetExtensionsStringEXT(ext);


Doing a debug shows that it executes every line in this code, including the one inside the if statement, and even after that line executes ext is STILL a null pointer (equal to 0). Perhaps the simplest of ARB extensions aren't supported by the hardware I'm using (generic intel gfx card), or perhaps there is some file I need to add to my list of references?

Share this post


Link to post
Share on other sites

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