vMcJohn/vogl — pull request #3 by grahamsellers (2014-05-22 21:01:39+00:00)
Title: Fix calling conventions for GL functions.

The calling convention for all GL functions should be defined as GLAPIENTRY. On
some platforms (esp. Linux), this is empty, resulting in whatever the default
calling convention is for the compiler. On Windows, however, the calling
convention should be __stdcall, which is _not_ the default of MSVC. Calling
functions through pointers declared with the wrong convention results in stack
corruption and ultimate doom, fire and brimstone.

This change defines GLAPIENTRY in gl_types.h as __stdcall on WGL, and empty
if it's not already defined. Throughout, I've used this define on anything
that may be called through to GL or by GL (including things like the debug
callback).

This pull will cause an assert on startup of the replayer as there seems to be a
mismatch on the expected type of the debug callback function pointer. Ignoring
the assert allows the trace to run.