Needed a change in flextGL to allow merging in 3rd party gl.xml
additions because Chrome is apparently a center of the universe and thus
doesn't need to bother upstreaming its extensions, ffs.
On desktop this saves about 50 kB in symbols. Was done for Vulkan
already, this follows that (two years later). I need this in order to
solve the problem of static globals being unique across shared libs, and
it sounded better to export just one symbol instead of 689.
It seems that there is no such thing as eglGetProcAddress() and thus we
are able to use only functions that are defined in the ES[23]/glext.h
header and no others. So, currently, the function loader internally
undefs all function name macros that were defined in our flextgl.h
header, then includes the Apple's glext.h header and assigns function
pointers of those extensions that are defined in the header. Apple also
has some minor differences in function signatures (different constness
of pointer-to-pointer variables) so I had to reinterpret_cast
everything.
Might seem to be uglier than including glext.h directly in our code,
but I made bad experience when doing so -- I want to depend on my
header bugs that are consistent across all platforms instead of
depending on whatever changes Apple makes in its headers. I also want to
have all functions defined and not only those that are supported on
iOS.
Phew. Thank you, flextGL, for making it way easier than it appeared to
be at first.