dcnieho/FreeGLUT — pull request #24 by sepehr-laal (2014-12-19 18:21:37+00:00)
Title: Externalized + centralized (some) types visible in freeglut_std.h

Ok, first off, let me start by the fact that C function pointers are extremely pain to make state-aware (well even `glutSetWindowData` is not enough in some cases where callback functions need to be allocated dynamically - imagine being embedded in a project where callbacks are coming from a Lua host, therefore they are not known at the compile time). I wanted not to change the type of the callbacks but I have to.

This is extremely important to C++ users and folks who try to embed Freeglut in their C++ related projects. There needs to be flexibility to change datatypes without breaking the underlying code.

As a rough example, if I want to change `void(*)(void)` to `std::function`, everything should still function perfectly fine in theory. This particular example also needs an `allocate` function to initialize the Freeglut's state struct. But you got the idea.

I attempted to change the callback types but everything in Freeglut's main include file (`freeglut_std.h`) is strictly typed in place instead of having a centralized place. So I am proposing the idea of centralizing `typedef`s that are visible via `freeglut_std.h` with this pull request.