OgreD3D11VertexDeclaration.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 __D3D11VERTEXDECLARATION_H__
29 #define __D3D11VERTEXDECLARATION_H__
30 
31 #include "OgreD3D11Prerequisites.h"
34 
35 namespace Ogre {
36 
39  {
40  protected:
42 
44 
46  typedef ShaderToILayoutMap::iterator ShaderToILayoutMapIterator;
48  typedef ShaderToInputDesc::iterator ShaderToInputDescIterator;
49 
51 
53 
56  ID3D11InputLayout * getILayoutByShader(D3D11HLSLProgram* boundVertexProgram, VertexBufferBinding* binding);
57  public:
60 
62  const VertexElement& addElement(unsigned short source, size_t offset, VertexElementType theType,
63  VertexElementSemantic semantic, unsigned short index = 0);
64 
66  const VertexElement& insertElement(unsigned short atPosition,
67  unsigned short source, size_t offset, VertexElementType theType,
68  VertexElementSemantic semantic, unsigned short index = 0);
69 
71  void removeElement(unsigned short elem_index);
72 
74  void removeElement(VertexElementSemantic semantic, unsigned short index = 0);
75 
77  void removeAllElements(void);
78 
79 
81  void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType,
82  VertexElementSemantic semantic, unsigned short index = 0);
83 
84 
85  D3D11_INPUT_ELEMENT_DESC * getD3DVertexDeclaration(D3D11HLSLProgram* boundVertexProgram, VertexBufferBinding* binding);
86  void bindToShader(D3D11HLSLProgram* boundVertexProgram, VertexBufferBinding* binding);
87 
88  };
89 
90 }
91 
92 #endif
Ogre::D3D11VertexDeclaration::removeAllElements
void removeAllElements(void)
See VertexDeclaration.
Ogre::D3D11VertexDeclaration::D3D11VertexDeclaration
D3D11VertexDeclaration(D3D11Device &device)
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::D3D11VertexDeclaration::removeElement
void removeElement(unsigned short elem_index)
See VertexDeclaration.
Ogre::map
Definition: OgrePrerequisites.h:533
Ogre::D3D11VertexDeclaration::mlpD3DDevice
D3D11Device & mlpD3DDevice
Definition: OgreD3D11VertexDeclaration.h:41
Ogre::D3D11VertexDeclaration::mD3delems
ShaderToInputDesc mD3delems
Definition: OgreD3D11VertexDeclaration.h:50
OgreHighLevelGpuProgramManager.h
Ogre::D3D11VertexDeclaration::mShaderToILayoutMap
ShaderToILayoutMap mShaderToILayoutMap
Definition: OgreD3D11VertexDeclaration.h:52
Ogre::D3D11VertexDeclaration
Specialisation of VertexDeclaration for D3D11.
Definition: OgreD3D11VertexDeclaration.h:38
Ogre::D3D11VertexDeclaration::insertElement
const VertexElement & insertElement(unsigned short atPosition, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
See VertexDeclaration.
Ogre::D3D11HLSLProgram
Specialization of HighLevelGpuProgram to provide support for D3D11 High-Level Shader Language (HLSL).
Definition: OgreD3D11HLSLProgram.h:48
Ogre::D3D11VertexDeclaration::~D3D11VertexDeclaration
~D3D11VertexDeclaration()
Ogre::VertexElementSemantic
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents.
Definition: OgreHardwareVertexBuffer.h:99
Ogre::VertexBufferBinding
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
Definition: OgreHardwareVertexBuffer.h:521
Ogre::VertexElementType
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
Definition: OgreHardwareVertexBuffer.h:123
Ogre::D3D11Device
Definition: OgreD3D11Device.h:36
OgreD3D11Prerequisites.h
Ogre::VertexDeclaration
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
Definition: OgreHardwareVertexBuffer.h:337
Ogre::D3D11VertexDeclaration::addElement
const VertexElement & addElement(unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
See VertexDeclaration.
Ogre::VertexElement
This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaratio...
Definition: OgreHardwareVertexBuffer.h:167
Ogre::D3D11VertexDeclaration::ShaderToInputDesc
map< D3D11HLSLProgram *, D3D11_INPUT_ELEMENT_DESC * >::type ShaderToInputDesc
Definition: OgreD3D11VertexDeclaration.h:47
Ogre::D3D11VertexDeclaration::ShaderToILayoutMapIterator
ShaderToILayoutMap::iterator ShaderToILayoutMapIterator
Definition: OgreD3D11VertexDeclaration.h:46
OgreHardwareVertexBuffer.h
Ogre::D3D11VertexDeclaration::bindToShader
void bindToShader(D3D11HLSLProgram *boundVertexProgram, VertexBufferBinding *binding)
Ogre::D3D11VertexDeclaration::ShaderToInputDescIterator
ShaderToInputDesc::iterator ShaderToInputDescIterator
Definition: OgreD3D11VertexDeclaration.h:48
Ogre::D3D11VertexDeclaration::getD3DVertexDeclaration
D3D11_INPUT_ELEMENT_DESC * getD3DVertexDeclaration(D3D11HLSLProgram *boundVertexProgram, VertexBufferBinding *binding)
Ogre::D3D11VertexDeclaration::mNeedsRebuild
bool mNeedsRebuild
Definition: OgreD3D11VertexDeclaration.h:43
Ogre::D3D11VertexDeclaration::modifyElement
void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
See VertexDeclaration.
Ogre::D3D11VertexDeclaration::getILayoutByShader
ID3D11InputLayout * getILayoutByShader(D3D11HLSLProgram *boundVertexProgram, VertexBufferBinding *binding)
Gets the D3D11-specific vertex declaration.
Ogre::D3D11VertexDeclaration::ShaderToILayoutMap
map< D3D11HLSLProgram *, ID3D11InputLayout * >::type ShaderToILayoutMap
Definition: OgreD3D11VertexDeclaration.h:45

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