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

# OgreD3D7TextureManager.cpp

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 © 2000-2002 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 #include "OgreD3D7TextureManager.h"
    00026 #include "OgreD3D7Texture.h"
    00027
    00028 namespace Ogre {
    00029
    00030 /* Auto-inlining must be disabled for this method otherwise problems with the
    00031    DLL boundary occur on the constructor in release mode. */
    00032 #if OGRE_COMPILER == COMPILER_MSVC
    00033     #pragma auto_inline( off )
    00034 #endif
    00035
    00036     D3DTextureManager::D3DTextureManager(LPDIRECT3DDEVICE7 lpD3D)
    00037         : TextureManager()
    00038     {
    00039         mlpD3DDevice = lpD3D;
    00040         lpD3D->AddRef();
    00041     }
    00042
    00043 #if OGRE_COMPILER == COMPILER_MSVC
    00044     #pragma auto_inline( on )
    00045 #endif
    00046
    00047     //-----------------------------------------------------------------------
    00048     D3DTextureManager::~D3DTextureManager()
    00049     {
    00050         this->unloadAndDestroyAll();
    00051
    00052         __safeRelease( &mlpD3DDevice );
    00053     }
    00054     //-----------------------------------------------------------------------
    00055     Texture* D3DTextureManager::create( const String& name, TextureType texType )
    00056     {
    00057         D3DTexture* t = new D3DTexture( name, texType, mlpD3DDevice, TU_DEFAULT );
    00058         t->enable32Bit(mIs32Bit);
    00059         return t;
    00060     }
    00061     //-----------------------------------------------------------------------
    00062     Texture * D3DTextureManager::createAsRenderTarget( const String& name )
    00063     {
    00064         D3DTexture* t = new D3DTexture( name, TEX_TYPE_2D, mlpD3DDevice, TU_RENDERTARGET );
    00065         t->enable32Bit( mIs32Bit );
    00066         t->load();
    00067         return t;
    00068     }
    00069     //-----------------------------------------------------------------------
    00070     Texture * D3DTextureManager::createManual(
    00071         const String & name,
    00072         TextureType texType,
    00073         uint width,
    00074         uint height,
    00075         uint num_mips,
    00076         PixelFormat format,
    00077         TextureUsage usage )
    00078     {
    00079         return new D3DTexture( name, texType, mlpD3DDevice, width, height, num_mips, format, usage );
    00080     }
    00081 }

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:19 2004