OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreD3D11Mappings.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 __D3D11MAPPINGS_H__
29 #define __D3D11MAPPINGS_H__
30 
31 #include "OgreD3D11Prerequisites.h"
32 #include "OgreTextureUnitState.h"
33 #include "OgreRenderSystem.h"
34 #include "OgreRoot.h"
35 #include "OgreD3D11RenderSystem.h"
36 
37 namespace Ogre
38 {
40  {
41  public:
42 
45  {
52  };
53 
55  //static DWORD get(ShadeOptions so);
57  //static D3DLIGHTTYPE get(Light::LightTypes lightType);
59  //static DWORD get(TexCoordCalcMethod m, const D3DCAPS9& caps);
61  static D3D11_TEXTURE_ADDRESS_MODE get(TextureUnitState::TextureAddressingMode tam);
63  static D3D11_BLEND get(LayerBlendType lbt);
65  //static DWORD get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps);
67  //static DWORD get(LayerBlendSource lbs);
69  static D3D11_BLEND get(SceneBlendFactor sbf, bool forAlpha);
71  static D3D11_BLEND_OP get(SceneBlendOperation sbo);
73  static D3D11_COMPARISON_FUNC get(CompareFunction cf);
75  static D3D11_CULL_MODE get(CullingMode cm, bool flip = false);
77  //static D3DFOGMODE get(FogMode fm);
79  static D3D11_FILL_MODE get(PolygonMode level);
81  static D3D11_STENCIL_OP get(StencilOperation op, bool invert = false);
83  static DWORD get(FilterType ft);
84  static D3D11_FILTER get(const FilterOptions minification, const FilterOptions magnification, const FilterOptions mips, const bool comparison = false);
86  static DWORD get(HardwareBuffer::Usage usage);
88  static D3D11_MAP get(HardwareBuffer::LockOptions options, HardwareBuffer::Usage usage);
90  static DXGI_FORMAT get(HardwareIndexBuffer::IndexType itype);
92  static DXGI_FORMAT getFormat(HardwareIndexBuffer::IndexType itype);
94  static DXGI_FORMAT get(VertexElementType vType);
96  static LPCSTR get(VertexElementSemantic sem);
97  static VertexElementSemantic get(LPCSTR sem);
99  static void get(const ColourValue& inColour, float * outColour );
100 
101 
103  static PixelFormat _getPF(DXGI_FORMAT d3dPF);
105  static DXGI_FORMAT _getPF(PixelFormat ogrePF);
106  //
107  static D3D11_USAGE _getUsage(HardwareBuffer::Usage mUsage);
108  static D3D11_USAGE _getUsage(int mUsage);
109  static UINT _getAccessFlags(HardwareBuffer::Usage mUsage);
110  static UINT _getAccessFlags(int mUsage);
111  static bool _isDynamic(HardwareBuffer::Usage mUsage);
112 
113  static bool _isDynamic(int mUsage);
114 
117 
118  static TextureType _getTexType(D3D11_SRV_DIMENSION type);
119 
120  static size_t _getSizeInBytes(PixelFormat pf, size_t xcount = 1, size_t ycount = 1);
121 
122  static UINT _getTextureBindFlags(DXGI_FORMAT format, bool isdynamic);
123  static UINT _getTextureMiscFlags(UINT bindflags, TextureType textype, bool isdynamic);
124  };
125 }
126 #endif
LayerBlendType
Type of texture blend mode.
Definition: OgreBlendMode.h:44
static DXGI_FORMAT getFormat(HardwareIndexBuffer::IndexType itype)
Class representing colour.
static TextureType _getTexType(D3D11_SRV_DIMENSION type)
static UINT _getAccessFlags(HardwareBuffer::Usage mUsage)
FilterType
Definition: OgreCommon.h:121
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:166
static UINT _getTextureMiscFlags(UINT bindflags, TextureType textype, bool isdynamic)
static bool _isDynamic(HardwareBuffer::Usage mUsage)
eD3DFilterUsage
enum identifying D3D11 filter usage type
LockOptions
Locking options.
static size_t _getSizeInBytes(PixelFormat pf, size_t xcount=1, size_t ycount=1)
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.
Usage
Enums describing buffer usage; not mutually exclusive.
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Definition: OgreCommon.h:87
static PixelFormat _getClosestSupportedPF(PixelFormat ogrePF)
utility method, find closest Ogre pixel format that D3D11 can support
static D3D11_USAGE _getUsage(HardwareBuffer::Usage mUsage)
TextureType
Enum identifying the texture type.
Definition: OgreTexture.h:76
PolygonMode
The polygon mode to use when rasterising.
Definition: OgreCommon.h:210
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
static PixelFormat _getPF(DXGI_FORMAT d3dPF)
utility method, convert D3D11 pixel format to Ogre pixel format
FilterOptions
Filtering options for textures / mipmaps.
Definition: OgreCommon.h:131
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:74
static UINT _getTextureBindFlags(DXGI_FORMAT format, bool isdynamic)