update global webgl context before calling texture methods, fixes #11