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

OgreD3D9Mappings.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 __D3D9MAPPINGS_H__
00026 #define __D3D9MAPPINGS_H__
00027 
00028 #include "OgreD3D9Prerequisites.h"
00029 #include "OgreCommon.h"
00030 #include "OgreLight.h"
00031 #include "OgreMaterial.h"
00032 #include "OgreRenderSystem.h"
00033 #include "OgreHardwareBuffer.h"
00034 #include "OgreHardwareIndexBuffer.h"
00035 
00036 #include "OgreNoMemoryMacros.h"
00037 #include <d3d9.h>
00038 #include <d3dx9.h>
00039 #include <dxerr9.h>
00040 #include "OgreMemoryMacros.h"
00041 
00042 namespace Ogre 
00043 {
00044     class D3D9Mappings
00045     {
00046     public:
00048         enum eD3DTexType
00049         {
00051             D3D_TEX_TYPE_NORMAL,
00053             D3D_TEX_TYPE_CUBE,
00055             D3D_TEX_TYPE_VOLUME,
00057             D3D_TEX_TYPE_NONE
00058         };
00059 
00061         enum eD3DFilterUsage
00062         {
00064             D3D_FUSAGE_MIN,
00066             D3D_FUSAGE_MAG,
00068             D3D_FUSAGE_MIP
00069         };
00070 
00072         static DWORD get(ShadeOptions so);
00074         static D3DLIGHTTYPE get(Ogre::Light::LightTypes lightType);
00076         static DWORD get(TexCoordCalcMethod m, const D3DCAPS9& caps);
00078         static D3DTEXTUREADDRESS get(TextureUnitState::TextureAddressingMode tam);
00080         static D3DTEXTURESTAGESTATETYPE get(LayerBlendType lbt);
00082         static DWORD get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps);
00084         static DWORD get(LayerBlendSource lbs);
00086         static D3DBLEND get(SceneBlendFactor sbf);
00088         static DWORD get(CompareFunction cf);
00090         static DWORD get(CullingMode cm, bool flip);
00092         static D3DFOGMODE get(FogMode fm);
00094         static D3DFILLMODE get(SceneDetailLevel level);
00096         static DWORD get(StencilOperation op, bool invert = false);
00098         static D3DSAMPLERSTATETYPE get(FilterType ft);
00100         static DWORD get(FilterType ft, FilterOptions fo, const D3DCAPS9& devCaps, eD3DTexType texType);
00102         static eD3DTexType get(TextureType ogreTexType);
00104         static DWORD get(HardwareBuffer::Usage usage);
00106         static DWORD get(HardwareBuffer::LockOptions options, HardwareBuffer::Usage usage);
00108         static D3DFORMAT get(HardwareIndexBuffer::IndexType itype);
00110         static D3DDECLTYPE get(VertexElementType vType);
00112         static D3DDECLUSAGE get(VertexElementSemantic sem);
00113         // Convert matrix to D3D style
00114         static  D3DXMATRIX makeD3DXMatrix( const Matrix4& mat );
00115         // Convert matrix from D3D style
00116         static Matrix4 D3D9Mappings::convertD3DXMatrix( const D3DXMATRIX& mat );
00117 
00118     };
00119 }
00120 #endif

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