OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreD3D9Mappings.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __D3D9MAPPINGS_H__
29 #define __D3D9MAPPINGS_H__
30 
31 #include "OgreD3D9Prerequisites.h"
32 #include "OgreCommon.h"
33 #include "OgreLight.h"
34 #include "OgreMaterial.h"
35 #include "OgreRenderSystem.h"
36 #include "OgreHardwareBuffer.h"
38 
39 namespace Ogre
40 {
42  {
43  public:
46  {
54  D3D_TEX_TYPE_NONE
55  };
56 
59  {
65  D3D_FUSAGE_MIP
66  };
67 
69  static DWORD get(ShadeOptions so);
71  static D3DLIGHTTYPE get(Ogre::Light::LightTypes lightType);
73  static DWORD get(TexCoordCalcMethod m, const D3DCAPS9& caps);
75  static D3DTEXTUREADDRESS get(TextureUnitState::TextureAddressingMode tam, const D3DCAPS9& devCaps);
77  static D3DTEXTURESTAGESTATETYPE get(LayerBlendType lbt);
79  static DWORD get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps);
81  static DWORD get(LayerBlendSource lbs, bool perStageConstants);
83  static D3DBLEND get(SceneBlendFactor sbf);
85  static D3DBLENDOP get(SceneBlendOperation sbo);
87  static DWORD get(CompareFunction cf);
89  static DWORD get(CullingMode cm, bool flip);
91  static D3DFOGMODE get(FogMode fm);
93  static D3DFILLMODE get(PolygonMode level);
95  static DWORD get(StencilOperation op, bool invert = false);
97  static D3DSAMPLERSTATETYPE get(FilterType ft);
99  static DWORD get(FilterType ft, FilterOptions fo, const D3DCAPS9& devCaps, eD3DTexType texType);
101  static eD3DTexType get(TextureType ogreTexType);
103  static DWORD get(HardwareBuffer::Usage usage);
105  static DWORD get(HardwareBuffer::LockOptions options, HardwareBuffer::Usage usage);
107  static D3DFORMAT get(HardwareIndexBuffer::IndexType itype);
109  static D3DDECLTYPE get(VertexElementType vType);
111  static D3DDECLUSAGE get(VertexElementSemantic sem);
112  // Convert matrix to D3D style
113  static D3DXMATRIX makeD3DXMatrix( const Matrix4& mat );
114  // Convert matrix from D3D style
115  static Matrix4 convertD3DXMatrix( const D3DXMATRIX& mat );
116 
118  static PixelFormat _getPF(D3DFORMAT d3dPF);
120  static D3DFORMAT _getPF(PixelFormat ogrePF);
122  static PixelFormat _getClosestSupportedPF(PixelFormat ogrePF);
123  };
124 }
125 #endif
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
LayerBlendType
Type of texture blend mode.
Definition: OgreBlendMode.h:44
FogMode
Fog modes.
Definition: OgreCommon.h:121
eD3DTexType
enum identifying D3D9 tex. types
LightTypes
Defines the type of light.
Definition: OgreLight.h:82
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
FilterType
Definition: OgreCommon.h:90
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents. ...
SceneBlendFactor
Blending factors for manually blending objects with the scene.
CullingMode
Hardware culling modes based on vertex winding.
Definition: OgreCommon.h:135
LockOptions
Locking options.
ShadeOptions
Light shading modes.
Definition: OgreCommon.h:113
PixelFormat
The pixel format used for images, textures, and render surfaces.
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
eD3DFilterUsage
enum identifying D3D9 filter usage type
#define _OgreD3D9Export
Usage
Enums describing buffer usage; not mutually exclusive.
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
LayerBlendSource
List of valid sources of values for blending operations used in TextureUnitState::setColourOperation ...
TextureType
Enum identifying the texture type.
Definition: OgreTexture.h:67
PolygonMode
The polygon mode to use when rasterising.
Definition: OgreCommon.h:179
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
LayerBlendOperationEx
Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx...
Definition: OgreBlendMode.h:75
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
FilterOptions
Filtering options for textures / mipmaps.
Definition: OgreCommon.h:100
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:64