Gentoo Archives: gentoo-alt

From: Fabian Groffen <grobian@g.o>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] Re: Mesa header in media-libs/apple-opengl-2
Date: Thu, 30 Apr 2009 19:53:24
In Reply to: [gentoo-alt] Re: Mesa header in media-libs/apple-opengl-2 by Dirk Tilger
On 28-04-2009 07:38:22 +0000, Dirk Tilger wrote:
> > Ok, have you tried if stuff works with modified apple-opengl not to > > provide osmesa.h? If so, I'm happy to remove the file from the ebuild. > > No, in fact I haven't any OpenGL application coming with an ebuild that > compiles on my box. ;) But I can provide strong evidence:
SDL needs it and compiles against it.
> | dirk@Snake ~ $ for PROC in `grep ^OSMesa /usr/X11R6/include/GL/osmesa.h|sed 's!(.*!!'`; do for LIB in `equery f apple-opengl|grep dylib`; do grep -H ${PROC} ${LIB}; done; done > | dirk@Snake ~ $ > > None of the methods defined in /usr/X11R6/include/GL/osmesa.h are > used or provided in any of the libraries in apple-opengl. ;) > > I think the ebuild needs a few more changes: It's symlinking GL dylib's > from /System/Library/Frameworks, which might have side-effects.
All I tried to do, is create something similar to mesa on Linux, with whatever Apple provides. It seems to work for some apps (SDL) at least. I tried to be as close to mesa as possible, since it's just eselect-ed, and hence used as drop-in replacement.
> As I came to understand OpenGL, it is a setup of platform independent > graphics routines that is used together with a set of platform dependent > setup routines. GLX provides the setup routines when OpenGL is used with > X11, AGL provides the setup routines when OpenGL is used with Quartz. > There are others for all kinds of other environments including Windows. > > /usr/X11R6/README says on my system: > | Direct rendering has exactly the same performance as the native Mac > | OS X OpenGL framework. Indirect rendering also uses the native GL > | implementation, but incurs the penalty of marshalling, transmitting > | and unmarshalling all GL primitives. > > I take from that paragraph is what they do is they are translating the > X11 OpenGL calls into Quartz OpenGL calls. That's probably why `otool -L > /usr/X11R6/lib/libGL.dylib` shows it has linked > > /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib > > When I look at the symlinks of media-libs/apple-opengl-2, I see some > pointing to /System/Library/Frameworks. I believe since GLX is the > classical Un*x way of doing OpenGL, we should probably take all OpenGL > files from within /usr/X11R6. For the ones that are actually running on > Quartz natively (let's say a OpenGL extension for vim ^^), I would > expect that they pick the OpenGL using '-framework OpenGL' and then they > get the files from /System/Library/Frameworks/OpenGL.framework > automatically..
Yeah, but the idea was to get automagically the best (native) for apps that just don't know (and don't want to know) about frameworks. Perhaps we just need two ebuilds instead of one? -- Fabian Groffen Gentoo on a different level