acquire and release opengl context