00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00034 #ifndef __SO3TEXTURE_H__ 00035 #define __SO3TEXTURE_H__ 00036 00037 #include "../SCOLBasic/SO3Std.h" 00038 #include "../SCOLBasic/SO3DataScol.h" 00039 00040 namespace SO3 00041 { 00042 00043 class STexture : public SData, public Ogre::ManualResourceLoader 00044 { 00045 public: 00046 protected: 00047 Ogre::TexturePtr O3TexturePtr; 00048 SScene* mScene; 00049 std::string mGroupName; 00050 private: 00051 size_t mWidth; 00052 size_t mHeight; 00053 00054 public: 00057 STexture(SScene* scene, std::string groupName, std::string textureName, std::string path, int w=0, int h=0); 00058 00061 ~STexture(); 00062 00065 void SetPath(char* newPath); 00066 00069 void SetPath(string newPath); 00070 00073 Ogre::TexturePtr getOgreTexturePointer(); 00074 00077 SScene* GetScene(); 00078 00081 std::string GetGroupName(); 00082 protected: 00083 private: 00087 STexture(); 00088 00091 virtual void loadResource(Ogre::Resource* resource); 00092 }; 00093 00094 } 00095 00096 #endif
1.6.3