#ifndef _IMAGEFACTORY_H_INCLUDED_ #define _IMAGEFACTORY_H_INCLUDED_ #include "ImageTarga.h" #include "ImagePVR.h" #include "ImagePNG.h" class ImageFactory { public: ImageFactory() {} virtual ~ImageFactory() {} static ImageGL* GetImageGL(const string& nameImage) { string strEnd = nameImage.substr(nameImage.size()-4); if (strEnd == ".pvr") { return new ImagePVR(); } if (strEnd == ".tga") { return new ImageTarga(); } if (strEnd == ".png") { return new ImagePNG(); } return NULL; } private: }; #endif // _IMAGEFACTORY_H_INCLUDED_
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The BSD License
Skills that self-taught computer programmers lack