engine: Make glwrap a C source file

Future changes could see multiple context state support, with a wrapper
for glfwMakeContextCurrent and internal window userdata (which GLFW
supports). For now, this implementation works fine.

Also added utility function get_clear_mask() which can be passed to
glClear to only clear necessary buffers.