Enforce lifetime constraints on anything requiring an OpenGL context.