OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-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 __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
D3D11_INPUT_ELEMENT_DESC * getD3DVertexDeclaration(D3D11HLSLProgram *boundVertexProgram, VertexBufferBinding *binding)
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
D3D11VertexDeclaration(D3D11Device &device)
const VertexElement & insertElement(unsigned short atPosition, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
See VertexDeclaration.
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents. ...
void bindToShader(D3D11HLSLProgram *boundVertexProgram, VertexBufferBinding *binding)
void removeAllElements(void)
See VertexDeclaration.
map< D3D11HLSLProgram *, ID3D11InputLayout * >::type ShaderToILayoutMap
This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaratio...
ShaderToInputDesc::iterator ShaderToInputDescIterator
ID3D11InputLayout * getILayoutByShader(D3D11HLSLProgram *boundVertexProgram, VertexBufferBinding *binding)
Gets the D3D11-specific vertex declaration.
map< D3D11HLSLProgram *, D3D11_INPUT_ELEMENT_DESC * >::type ShaderToInputDesc
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
See VertexDeclaration.
void removeElement(unsigned short elem_index)
See VertexDeclaration.
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
ShaderToILayoutMap::iterator ShaderToILayoutMapIterator
Specialisation of VertexDeclaration for D3D11.
const VertexElement & addElement(unsigned short source, size_t offset, VertexElementType theType, VertexElementSemantic semantic, unsigned short index=0)
See VertexDeclaration.
Specialization of HighLevelGpuProgram to provide support for D3D11 High-Level Shader Language (HLSL)...