In your message of 10 September 1999 you write:
> On Fri, 10 Sep 1999, Thomas Roell wrote:
>
> > > OK - but you still have to call the gl version from the context in
> > > which you'll call the function that it returns. (That would certainly
> > > HAVE to be the case for EXT functions - so we might as well make
> > > it the rule for all functions - if only to simplify the manual!)
> >
> > It's still an ugly problem. For an application programmers point of
> > view, I really don't like the idea of GetProcAddress() be dependant
> > upon the context it's called under. It's just a nightmare and a
> > predictable recipe for disaster. On the other hand, letting libGL do
> > the indirection for unknown extensions is very tricky.
>
> On the other hand, MANY programmers only ever work in one context,
> and if they use GLUT, they aren't even aware of the existance of
> contexts and such.
>
> Relatively few programmers (I suspect) are into multiple contexts,
> and if they are, will be painfully aware of the consequences of
> getting things like this wrong.
>
> Look at it this way: All of the other gl* functions are assumed to
> be "in the present context" - why should glGetFuncAddress be any
> different?
>
> We are not demanding to have:
>
> glGetError ( context, ... ) ;
> glAreTexturesResident ( context, ... ) ;
>
> ...etc?
>
> Is this really all that different?
Yes, it is different. Look at the two functions below:
void (*rect)();
foo_1()
{
glRectf(0.0, 0.0, 1.0, 1.0);
}
foo_2()
{
(*rect)(0.0, 0.0, 1.0, 1.0);
}
main()
{
rect = glGetProcAddressEXT("glRectf");
}
foo_1() can be called regardless of which context is current. foo_2()
can only be called with whatever context was current when
glGetProcAddressEXT was called. In order to make things work for
foo_2() it has to be reformulated in a bizarre way:
foo_2()
{
(*glGetProcAddressEXT("glRectf"))(0.0, 0.0, 1.0, 1.0);
}
The key difference between GetProcAddress and all other OpenGL
functions is, that it really returns a pointer to a function. It looks
more like glXMakeCurrent(), as it does not really belong into the API
itself.
- Thomas
--
Thomas Roell /\ An imperfect plan executed violently
Xi Graphics / \/\ _ is far superior to a perfect plan.
[EMAIL PROTECTED] / / \ \
/ Oelch! \ \ George Patton