PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: TextureCreator.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLRENDERER_TEXTURECREATOR_H__ 00024 #define __PLRENDERER_TEXTURECREATOR_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLCore/Base/Object.h> 00032 #include "PLRenderer/PLRenderer.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLRenderer { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Forward declarations ] 00043 //[-------------------------------------------------------] 00044 class Texture; 00045 class TextureManager; 00046 00047 00048 //[-------------------------------------------------------] 00049 //[ Classes ] 00050 //[-------------------------------------------------------] 00051 /** 00052 * @brief 00053 * Abstract texture creator base class 00054 */ 00055 class TextureCreator : public PLCore::Object { 00056 00057 00058 //[-------------------------------------------------------] 00059 //[ Friends ] 00060 //[-------------------------------------------------------] 00061 friend class TextureManager; 00062 00063 00064 //[-------------------------------------------------------] 00065 //[ RTTI interface ] 00066 //[-------------------------------------------------------] 00067 pl_class(PLRENDERER_RTTI_EXPORT, TextureCreator, "PLRenderer", PLCore::Object, "Abstract texture creator base class") 00068 pl_class_end 00069 00070 00071 //[-------------------------------------------------------] 00072 //[ Protected functions ] 00073 //[-------------------------------------------------------] 00074 protected: 00075 /** 00076 * @brief 00077 * Default constructor 00078 */ 00079 PLRENDERER_API TextureCreator(); 00080 00081 /** 00082 * @brief 00083 * Destructor 00084 */ 00085 PLRENDERER_API virtual ~TextureCreator(); 00086 00087 /** 00088 * @brief 00089 * Creates the texture if a null pointer is given 00090 * 00091 * @param[in] cTextureManager 00092 * Texture manager to use 00093 * @param[in] pTexture 00094 * Pointer to the texture, if a null pointer a new texture is created 00095 * 00096 * @return 00097 * The created texture, a null pointer on error 00098 */ 00099 PLRENDERER_API Texture *CreateTexture(TextureManager &cTextureManager, Texture *pTexture) const; 00100 00101 00102 //[-------------------------------------------------------] 00103 //[ Protected virtual TextureCreator functions ] 00104 //[-------------------------------------------------------] 00105 protected: 00106 /** 00107 * @brief 00108 * Creates a texture 00109 * 00110 * @param[in] cTextureManager 00111 * Texture manager to use 00112 * @param[in] pTexture 00113 * Texture to manipulate, if a null pointer a new texture is created 00114 * 00115 * @return 00116 * The created/manipulated texture, a null pointer on error 00117 */ 00118 virtual Texture *Create(TextureManager &cTextureManager, Texture *pTexture = nullptr) const = 0; 00119 00120 00121 }; 00122 00123 00124 //[-------------------------------------------------------] 00125 //[ Namespace ] 00126 //[-------------------------------------------------------] 00127 } // PLRenderer 00128 00129 00130 #endif // __PLRENDERER_TEXTURECREATOR_H__
|