Avoid crash with nVidia driver nvoglv32.dll

  - change order of the texture related calls