This patch separates graphics context creation from window code in Ghost so that they can vary separately.
This allows desktop (CGL,GLX,WGL) and embedded (EGL) code to be separated.
(More ambitiously it sets the stage for somebody to write a Mantel, Metal, Direct3D, or whatever backend for the game engine)
The meaning of the new build options are here: http://wiki.blender.org/index.php/User:Jwilkins/VFX/GHOST_Refactor_for_EGL
Recently I added an option WITH_X11 so I could build the glX context on OSX that is not documented yet. I only meant it for development purposes, but having a WITH_X11 variable actually makes some of the build code cleaner in places.
The new WGL and EGL context classes have more features than the CGL or glX contexts, but all the contexts should behave as they did before. This just means that only WGL and EGL are capable of requesting extended functionality such as core GL.
Note: Visual selection is done after creating an X window, which is technically backwards, but it worked on OSX.
Note: I removed some code that was not being used.
Note: I moved the OSX locale query to the boost locale wrapper
Sorry for the delay, this has been ready for somebody to look at it for a while, but I was not assertive enough about getting it looked at.