# 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
    00097         virtual TexturePtr loadImage(
    00098             const String &name, const String& group, const Image &img,
    00099             TextureType texType = TEX_TYPE_2D,
    00100             int iNumMipmaps = -1, Real gamma = 1.0f);
    00101
    00127         virtual TexturePtr loadRawData(const String &name, const String& group,
    00128             DataStreamPtr& stream, ushort uWidth, ushort uHeight,
    00129             PixelFormat format, TextureType texType = TEX_TYPE_2D,
    00130             int iNumMipmaps = -1, Real gamma = 1.0f);
    00131
    00166         virtual TexturePtr createManual(const String & name, const String& group,
    00167             TextureType texType, uint width, uint height, uint depth,
    00168             int num_mips, PixelFormat format, int usage = TU_DEFAULT, ManualResourceLoader* loader = 0 );
    00169
    00204         TexturePtr createManual(const String & name, const String& group,
    00205             TextureType texType, uint width, uint height, int num_mips,
    00206             PixelFormat format, int usage = TU_DEFAULT, ManualResourceLoader* loader = 0 )
    00207         {
    00208             return createManual(name, group, texType, width, height, 1,
    00209                 num_mips, format, usage, loader);
    00210         }
    00211
    00214         virtual void enable32BitTextures(bool setting = true);
    00215
    00218         virtual bool isEnable32BitTextures(void)
    00219         {
    00220             return mIs32Bit;
    00221         }
    00222
    00231         virtual void setDefaultNumMipmaps(size_t num);
    00232
    00235         virtual size_t getDefaultNumMipmaps()
    00236         {
    00237             return mDefaultNumMipmaps;
    00238         }
    00239
    00255         static TextureManager& getSingleton(void);
    00271         static TextureManager* getSingletonPtr(void);
    00272
    00273     protected:
    00274
    00275         bool mIs32Bit;
    00276         size_t mDefaultNumMipmaps;
    00277     };
    00278 }// Namespace
    00279
    00280 #endif

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:54 2006