[.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);
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 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 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.

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

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?

Create an account

Register a new account