Make TEXTURE into a proper C++ class.

Amend sample programs which use the TEXTURE class to use the new class
methods.