Fix for OSX crashes, using an openGL function before the context is created