Cache openGL to avoid glGet calls

https://github.com/BeamNG/Torque3D/commit/b169e6e7aa9bf9cb0d40b547f8582c7085e43b33