Update

made the create texture function and fixed the infinit loop that was
happening