checking OpenGL bind state before performing operations