Use an OpenGL debug context in debug builds