DerelictOrg/DerelictGL3 — pull request #6 by chris0210 (2014-03-01 15:54:53+00:00)
Title: Attempt to negate the need to repetively call reload() on context-switch

The current implementation forces to call `reload()` each time a context is bound. This is, as far as I know, due to the wgl-Specification stating that the function-adresses depend upon the context (or it's pixel format).
In this pull request I offer a first attempt for a solution to this.

Instead of loading the opengl function pointers into global variables as `reload()` does, the new function `reloadOnce(out functions)` takes an object named `functions` of type `ContextDependendFunctions` as a parameter. This object has function-pointer members for all opengl-functions that depend on the context (in other words that are not loaded by `loadSymbols()`). The `reloadOnce()` function fills these members with the appropriate function pointers for the currently bound context.

Instead of calling `reload()` each time a context is bound, you can simply call `reloadOnce()` for each context directly after the creation of the context and store the resulting `functions` object along with the context. Instead of calling opengl functions globally, you can now call the functions using the pointers in the `functions` object. When a new context is bound, there is no more need to call `reload()`, but instead you must use the corresponding `functions` object for this context.

Note that is is a first attempt and criticism is welcome. Also I preserved the original `reload()` functionality for downward compatibility. Also ARB extensions are not yet transfered in to the new system.