Thomas Roell wrote:
> > For the record, here's my super condensed opinion:
> >
> > In a single screen, homogeneous driver environment, it makes no difference.
> >
> > In a multi screen, heterogeneous environment, glGetString may return different
> > extension strings for different contexts, therefore glGetAnythingEXT
> > must return context-specific information. An app must check the extensions
> > per-context, so it must do *all* its extension specific setup per-context,
>including
> > obtaining function pointers.
>
> I fully agree here with you. The only thing where I'm a little bit
> hung up is whether core API functions retrieved via
> glXGetProcAddressEXT() are also context dependant.
You're right. Someone previously noted that glGetProcAddressEXT served two purposes:
1) to obtain new extension procedures that are unknown to libGL.so, and 2) to obtain
core function pointers directly from the driver to bypass a wrapper layer implemented
by libGL.so. So, we're trying to 1) add functionality, and 2) provide an alternative
coding
method for apps to improve performance.
I submit that GL_EXT_get_proc_address is provided to address 1) and that there are
much better ways to address 2). On the Macintosh, an app can bypass the wrappers and
access the entire entry point set directly from the driver by including an additional
header
that allows the app to dereference the context. For example:
glVertex2f(x, y); /* normal method */
becomes
myContext->disp.vertex2f(myContext->rend, x, y); /* direct method */
This is a much smaller burden on the app than programmatically obtaining each
required function pointer by name and storing it in local space.
As you might guess, optional macros are provided to make the code for the "direct"
method look exactly like the "normal" method. Even the core functions
from the driver are actually context specific, and may change with changes in GL
state. This fact is either hidden from the app by the wrappers or apparent to
an app that uses the direct method. Either way, the app doesn't have to take any
additional steps to obtain the pointers.
Bob Beretta
Apple Computer