OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OgreD3D10Mappings.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-2011 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 __D3D10MAPPINGS_H__
29 #define __D3D10MAPPINGS_H__
30 
31 #include "OgreD3D10Prerequisites.h"
32 #include "OgreTextureUnitState.h"
33 #include "OgreRenderSystem.h"
34 
35 namespace Ogre
36 {
38  {
39  public:
42  {
51  };
52 
55  {
62  };
63 
65  //static DWORD get(ShadeOptions so);
67  //static D3DLIGHTTYPE get(Light::LightTypes lightType);
69  //static DWORD get(TexCoordCalcMethod m, const D3DCAPS9& caps);
71  static D3D10_TEXTURE_ADDRESS_MODE get(TextureUnitState::TextureAddressingMode tam);
73  static D3D10_BLEND get(LayerBlendType lbt);
75  //static DWORD get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps);
77  //static DWORD get(LayerBlendSource lbs);
79  static D3D10_BLEND get(SceneBlendFactor sbf);
81  static D3D10_COMPARISON_FUNC get(CompareFunction cf);
83  static D3D10_CULL_MODE get(CullingMode cm, bool flip = false);
85  //static D3DFOGMODE get(FogMode fm);
87  static D3D10_FILL_MODE get(PolygonMode level);
89  static D3D10_STENCIL_OP get(StencilOperation op, bool invert = false);
91  static DWORD get(FilterType ft);
92  static D3D10_FILTER get(const FilterOptions minification, const FilterOptions magnification, const FilterOptions mips, const bool comparison = false);
94  //static DWORD get(FilterType ft, FilterOptions fo, const D3DCAPS9& devCaps, eD3DTexType texType);
96  static eD3DTexType get(TextureType ogreTexType);
98  static DWORD get(HardwareBuffer::Usage usage);
100  static D3D10_MAP get(HardwareBuffer::LockOptions options, HardwareBuffer::Usage usage);
102  static DXGI_FORMAT get(HardwareIndexBuffer::IndexType itype);
103  static UINT getByteWidth(HardwareIndexBuffer::IndexType itype);
104  static DXGI_FORMAT getFormat(HardwareIndexBuffer::IndexType itype);
106  static DXGI_FORMAT get(VertexElementType vType);
108  static LPCSTR get(VertexElementSemantic sem,unsigned short index);
110  static void get(const ColourValue& inColour, float * outColour );
111 
112 
113  // Convert matrix to D3D style
114  static D3DXMATRIX makeD3DXMatrix( const Matrix4& mat );
115  // Convert matrix from D3D style
116  static Matrix4 convertD3DXMatrix( const D3DXMATRIX& mat );
117 
119  static PixelFormat _getPF(DXGI_FORMAT d3dPF);
121  static DXGI_FORMAT _getPF(PixelFormat ogrePF);
122  //
123  static D3D10_USAGE _getUsage(HardwareBuffer::Usage mUsage);
124  static D3D10_USAGE _getUsage(int mUsage);
125  static UINT _getAccessFlags(HardwareBuffer::Usage mUsage);
126  static UINT _getAccessFlags(int mUsage);
127  static bool _isDynamic(HardwareBuffer::Usage mUsage);
130  };
131 }
132 #endif
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
static PixelFormat _getClosestSupportedPF(PixelFormat ogrePF)
utility method, find closest Ogre pixel format that D3D10 can support
static DXGI_FORMAT getFormat(HardwareIndexBuffer::IndexType itype)
LayerBlendType
Type of texture blend mode.
Definition: OgreBlendMode.h:44
Class representing colour.
static D3DXMATRIX makeD3DXMatrix(const Matrix4 &mat)
FilterType
Definition: OgreCommon.h:91
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents. ...
static PixelFormat _getPF(DXGI_FORMAT d3dPF)
utility method, convert D3D10 pixel format to Ogre pixel format
SceneBlendFactor
Blending factors for manually blending objects with the scene.
CullingMode
Hardware culling modes based on vertex winding.
Definition: OgreCommon.h:136
LockOptions
Locking options.
static UINT getByteWidth(HardwareIndexBuffer::IndexType itype)
PixelFormat
The pixel format used for images, textures, and render surfaces.
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
static bool _isDynamic(HardwareBuffer::Usage mUsage)
Usage
Enums describing buffer usage; not mutually exclusive.
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
static Matrix4 convertD3DXMatrix(const D3DXMATRIX &mat)
eD3DFilterUsage
enum identifying D3D10 filter usage type
eD3DTexType
enum identifying D3D10 tex. types
TextureType
Enum identifying the texture type.
Definition: OgreTexture.h:67
PolygonMode
The polygon mode to use when rasterising.
Definition: OgreCommon.h:180
static UINT _getAccessFlags(HardwareBuffer::Usage mUsage)
StencilOperation
Enum describing the various actions which can be taken onthe stencil buffer.
FilterOptions
Filtering options for textures / mipmaps.
Definition: OgreCommon.h:101
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:65
static D3D10_USAGE _getUsage(HardwareBuffer::Usage mUsage)