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-2013 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
Ogre::TextureUnitState::TextureAddressingMode
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
Definition: OgreTextureUnitState.h:126
Ogre
Definition: OgreAndroidLogListener.h:34
OgreTextureUnitState.h
OgreRoot.h
Ogre::D3D11Mappings::D3D_FUSAGE_MAG
@ D3D_FUSAGE_MAG
mag filter
Definition: OgreD3D11Mappings.h:49
Ogre::D3D11Mappings::_getTextureBindFlags
static UINT _getTextureBindFlags(DXGI_FORMAT format, bool isdynamic)
Ogre::D3D11Mappings::_getTexType
static TextureType _getTexType(D3D11_SRV_DIMENSION type)
Ogre::D3D11Mappings::_getPF
static PixelFormat _getPF(DXGI_FORMAT d3dPF)
utility method, convert D3D11 pixel format to Ogre pixel format
Ogre::D3D11Mappings::_getUsage
static D3D11_USAGE _getUsage(HardwareBuffer::Usage mUsage)
Ogre::D3D11Mappings::D3D_FUSAGE_MIP
@ D3D_FUSAGE_MIP
mip filter
Definition: OgreD3D11Mappings.h:51
Ogre::D3D11Mappings::_getClosestSupportedPF
static PixelFormat _getClosestSupportedPF(PixelFormat ogrePF)
utility method, find closest Ogre pixel format that D3D11 can support
Ogre::LayerBlendType
LayerBlendType
Type of texture blend mode.
Definition: OgreBlendMode.h:44
Ogre::CompareFunction
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:64
Ogre::VertexElementSemantic
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents.
Definition: OgreHardwareVertexBuffer.h:99
Ogre::D3D11Mappings::eD3DFilterUsage
eD3DFilterUsage
enum identifying D3D11 filter usage type
Definition: OgreD3D11Mappings.h:44
Ogre::VertexElementType
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
Definition: OgreHardwareVertexBuffer.h:123
Ogre::StencilOperation
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Definition: OgreRenderSystem.h:81
Ogre::SceneBlendFactor
SceneBlendFactor
Blending factors for manually blending objects with the scene.
Definition: OgreBlendMode.h:234
OgreD3D11Prerequisites.h
Ogre::D3D11Mappings
Definition: OgreD3D11Mappings.h:39
Ogre::D3D11Mappings::D3D_FUSAGE_MIN
@ D3D_FUSAGE_MIN
min filter
Definition: OgreD3D11Mappings.h:47
Ogre::PixelFormat
PixelFormat
The pixel format used for images, textures, and render surfaces.
Definition: OgrePixelFormat.h:43
Ogre::D3D11Mappings::_getAccessFlags
static UINT _getAccessFlags(HardwareBuffer::Usage mUsage)
Ogre::FilterOptions
FilterOptions
Filtering options for textures / mipmaps.
Definition: OgreCommon.h:100
OgreD3D11RenderSystem.h
Ogre::HardwareIndexBuffer::IndexType
IndexType
Definition: OgreHardwareIndexBuffer.h:49
Ogre::CullingMode
CullingMode
Hardware culling modes based on vertex winding.
Definition: OgreCommon.h:135
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::D3D11Mappings::get
static D3D11_TEXTURE_ADDRESS_MODE get(TextureUnitState::TextureAddressingMode tam)
return a D3D11 equivalent for a Ogre ShadeOptions value
Ogre::HardwareBuffer::Usage
Usage
Enums describing buffer usage; not mutually exclusive.
Definition: OgreHardwareBuffer.h:79
Ogre::D3D11Mappings::_getSizeInBytes
static size_t _getSizeInBytes(PixelFormat pf, size_t xcount=1, size_t ycount=1)
Ogre::D3D11Mappings::getFormat
static DXGI_FORMAT getFormat(HardwareIndexBuffer::IndexType itype)
Ogre::TextureType
TextureType
Enum identifying the texture type.
Definition: OgreTexture.h:67
Ogre::HardwareBuffer::LockOptions
LockOptions
Locking options.
Definition: OgreHardwareBuffer.h:121
Ogre::D3D11Mappings::getByteWidth
static UINT getByteWidth(HardwareIndexBuffer::IndexType itype)
Ogre::D3D11Mappings::_getTextureMiscFlags
static UINT _getTextureMiscFlags(UINT bindflags, TextureType textype, bool isdynamic)
Ogre::FilterType
FilterType
Definition: OgreCommon.h:90
Ogre::PolygonMode
PolygonMode
The polygon mode to use when rasterising.
Definition: OgreCommon.h:179
Ogre::D3D11Mappings::_isDynamic
static bool _isDynamic(HardwareBuffer::Usage mUsage)
Ogre::SceneBlendOperation
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
Definition: OgreBlendMode.h:253
OgreRenderSystem.h

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15