Yay OpenGL stupidness
Posted by nuxi on 2010-Aug-24 at 00:05:44 in Computers (Login to reply)
So, there is this function named glXProcGetAddress() that will return the memory address of an OpenGL function. Here is what it gives for 3 function names when compiled for 64-bit:
$ ./test64
glTexSubImage2D = 0x7fbc98e80b00
glProvokingVertex = 0x7fbc98e82760
glBogusFunctionName = (nil)
But this is what the binary says on 32-bit:
$ ./test32
glTexSubImage2D = 0xf774c880
glProvokingVertex = 0x8b33008
glBogusFunctionName = 0x8b33038
LOLWUT?
Okay so turns out the ia32-libs package in Debian is just a little bit outdated. So I hack upgraded it by manually pulling in the OpenGL stuff from the i386 packages. Its a little better now:
$ ./test32
glTexSubImage2D = 0xf7745db0
glProvokingVertex = 0xf7747a10
glBogusFunctionName = 0x8bba008
glProvokingVertex now has a more reasonable looking memory address. I find it more than a bit disturbing that a bogus function name does not return NULL, but according to someone in #winehq thats just fine by the spec. I still can't run Eve under Wine though. Turns out Eve requires S3TC, which is a bit patented and my open source video drivers don't support it.