Re: Another Follow up (Re: OpenGL Headers and libraries under X11)
Re: Another Follow up (Re: OpenGL Headers and libraries under X11)
- Subject: Re: Another Follow up (Re: OpenGL Headers and libraries under X11)
- From: "Torrey T. Lyons" <email@hidden>
- Date: Thu, 15 Jan 2004 21:59:11 -0800
At 7:09 PM -0800 1/15/04, Steven Langer wrote:
I think there are a couple of misconceptions in this message thread.
Kurt Zimmerman wants to use the GL_ARB_fragment_program extension in
his program. glxinfo indicates that this extension is available
under OS X. Kurt tried
grep GL_ARB_fragment_program /usr/X11R6/include/GL/*h
and couldn't find the extension. If he had typed:
grep GL_ARB_fragment_program
/System/Library/Frameworks/OpenGL.framework/Headers/*.h
he would have found the desired extension. The glext.h file in that
directory contains the constants that allow you to use the
extensions.
I think Torrey's real point is that the gl.h header and libGL
implementation distributed by XFree86 don't include this extension.
It is nevertheless possible for an X11 server based on XFree86 to
provide this extension.
Yes, of course, it is possible. Apple's approach to providing an X
server for Mac OS X has been to leverage open source code. Apple
could develop their own custom GLX support with all the features of
Mac OS X's OpenGL framework. This would involve quite a lot of work
up front and would likely mean forking from the XFree86 code base so
that there would be on going maintenance to do in future. (If you
aren't compatible with XFree86 as it evolves, the point of an X11
compatibility environment is largely lost.) What all this effort
would get you is support for a few new extensions. For most things,
GLX is already exactly as fast as native OpenGL.
Linux systems, for example, use XFree86. Graphics vendors like ATI
and Nvidia provide their own libGL on Linux and it contains lots of
extensions. To write programs using those extensions, you can't rely
on the XFree86 gl.h file. You need to use a gl.h supplied by the
graphics card vendor to get the values for the constants associated
with the various extensions (or you can find the constants by
searching the Internet).
The patches supplied by these vendors replace both XFree86's GLX
header files and libraries. There are some compatibility issues which
you can read about on the vendors' web pages, but generally they try
to make sure they are backwards compatible with XFree86's GLX
implementation.
The ATI and NVidia patches to XFree86 are closed source and made
available so these vendors can sell more boards. Note that ATI's
solutions are only available on one platform (Intel x86) and one OS
(Linux) for the newest cards. (NVidia also has drivers for FreeBSD.)
These vendors feel it makes business sense to do the work to support
some cards in this way. I don't think these closed source solutions
are a good example for Apple.
Apple said "this issue does not originate with APPLE-TECHNOLOGY".
That is true, but it doesn't seem to be helpful. It looks to me like
Apple offers an OpenGL that includes quite a few useful extensions.
The problem is that the necessary OpenGL headers are split across
two directories and that you need to get the right version of each
header. I believe a helpful answer would be:
1) Modify your makefile or build system so it first searches for
headers in /System/Library/Frameworks/OpenGL.framework/Headers/.
This will make sure you get the "good" gl.h and glext.h.
2) Put /usr/X11R6/include/GL second on your search path so that you
can find glx.h.
I haven't tried this myself, but it is very similar to the approach
I need to take on Linux systems. I hope this proves helpful.
Unfortunately, what you suggested will probably not work. You
typically can't mix and match the OpenGL framework headers and GLX
libraries. You should pick one API and stick with it. Currently, GLX
happens to support less then native OpenGL does. Using other
solutions such as GLEW are probably the best way to go if you need to
stick with X11.
--Torrey
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.