[cairo] [cairo-gl] RFC: Dispatching mechanism for non-standard GL functions

Benjamin Otte otte at redhat.com
Thu Dec 2 01:02:44 PST 2010

On Tue, 2010-11-30 at 11:29 -0500, Behdad Esfahbod wrote:
> On 11/30/10 11:16, Kristian Høgsberg wrote:
> > I think that looks very promising.  How many "regular" gl calls are
> > left?  It looks to me like it could be feasible to just lookup all gl
> > entry points.  That would let us dlopen libGL.so or libGLESv2.so at
> > runtime and lookup all entry points.  My only reservation about this
> > was that we need to know where libGL.so is, but reading the dlopen man
> > page that's not true.  If you just dlopen("libGL.so") it will look in
> > the same places as the dynamic linker, including LD_LIBRARY_PATH etc.
> > So I'm leaning towards that idea now to avoid making the choice
> > between GL or GLES2 a compile time decision.
> Agreed.  Maybe we should do this for all backends (xlib, xcb, directfb, ...).
>  That would *fix* the problem that currently any program linking to libcairo
> will link in all the enabled backends at runtime.
Yes, We are so much better at writing a linker than the guys working on
ld. And it worked so well for X.

Seriously, if we're getting into not linking at compile-time and start
linking at runtime, we're doing it wrong.


More information about the cairo mailing list