Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreTextureManager.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef _TextureManager_H__
00026 #define _TextureManager_H__
00027 
00028 
00029 #include "OgrePrerequisites.h"
00030 
00031 #include "OgreResourceManager.h"
00032 #include "OgreTexture.h"
00033 #include "OgreSingleton.h"
00034 
00035 
00036 namespace Ogre {
00037 
00051     class _OgreExport TextureManager : public ResourceManager, public Singleton<TextureManager>
00052     {
00053     public:
00054 
00055         TextureManager(bool enable32Bit = true);
00056         virtual ~TextureManager();
00057 
00073         virtual TexturePtr load( 
00074             const String& name, const String& group, 
00075             TextureType texType = TEX_TYPE_2D, int numMipmaps = -1, 
00076             Real gamma = 1.0f);
00077 
00095         virtual TexturePtr loadImage( 
00096             const String &name, const String& group, const Image &img, 
00097             TextureType texType = TEX_TYPE_2D,
00098             int iNumMipmaps = -1, Real gamma = 1.0f);
00099             
00123         virtual TexturePtr loadRawData(const String &name, const String& group,
00124             DataStreamPtr& stream, ushort uWidth, ushort uHeight, 
00125             PixelFormat format, TextureType texType = TEX_TYPE_2D, 
00126             int iNumMipmaps = -1, Real gamma = 1.0f);
00127 
00162         virtual TexturePtr createManual(const String & name, const String& group,
00163             TextureType texType, uint width, uint height, uint depth, 
00164             int num_mips, PixelFormat format, int usage = TU_DEFAULT, ManualResourceLoader* loader = 0 );
00165             
00200         TexturePtr createManual(const String & name, const String& group,
00201             TextureType texType, uint width, uint height, int num_mips,
00202             PixelFormat format, int usage = TU_DEFAULT, ManualResourceLoader* loader = 0 )
00203         {
00204             return createManual(name, group, texType, width, height, 1, 
00205                 num_mips, format, usage, loader);
00206         }
00207 
00210         virtual void enable32BitTextures(bool setting = true);
00211 
00220         virtual void setDefaultNumMipmaps(size_t num);
00221 
00224         virtual size_t getDefaultNumMipmaps()
00225         {
00226             return mDefaultNumMipmaps;
00227         }
00228 
00244         static TextureManager& getSingleton(void);
00260         static TextureManager* getSingletonPtr(void);
00261 
00262     protected:
00263 
00264         bool mIs32Bit;
00265         size_t mDefaultNumMipmaps;
00266     };
00267 }// Namespace
00268 
00269 #endif

Copyright © 2000-2005 by The OGRE Team
Last modified Sun Apr 10 23:21:24 2005