Problems with glext.h

I was just looking at OpenGL updates on OS X Lion when I discovered what I was now scared to useglext.h .

So here is the mistake. Lion OpenGL.framework has the glext.hfollowing definition.

typedef void *GLhandleARB;

But glext.hfrom the registry, OpenGL has the following.

typedef unsigned int GLhandleARB;

Now the problem is that when building for x86_64 on Lion we have sizeof(void*)==8, but sizeof(unsigned int)==4. So what do you trust? Lion heading? Or the OpenGL registry header? Well, of course, you trust the system headers because, apparently, they claim that the ABI on the 64-bit Lion is of the 64-bit type GLhandleARB.

Now, this causes several problems in my head about various platforms:

  • If you must use Apple glext.h, but Apple glext.hdoes not provide access to anything later than OpenGL 2.1, then how can you access the 3.0+ features on new cards?

    / li>
  • Is it unsafe to use the OpenGL registry glext.hon Linux? Or should you also use the system glext.h? In this case, question No. 1 also applies here.

  • How do you deal with things on Windows where the system has never been glext.h? You obviously cannot use a driver provider glext.h, because different providers may not agree with the sizes of different types. (Or is it not?) What is the deal here?

+5
source share
2 answers

. OS/drivers, . OpenGL, . (, GLEW)

, GLhandleARB, , Mac * - , Linux - - - , Linux AMD - - - .

, , .

1) OpenGL, , Apple. OpenGL 3.2 10.7. (, Nvidia - gpus OpenGL 3.3, ).

2) . OpenGL 2.1 , , , . "#include", .so.

3) , . , , glext OpenGL.

. . , , . (, GLEW).

+2

OpenGL , OpenGL, : glGetString(GL_EXTENSIONS)

, , , Apple: http://lists.apple.com/archives/mac-opengl/2005/Nov/msg00182.html

; , GLhandleARB, , 32 . , OpenGL 2.0 API- GLhandle, GLuint . , GLuint int Mac OS X, , :)

0

All Articles