Functions | |
ID3D11InputLayout_ptr | tk11::create_input_layout (ID3D11Device_ptr device, const D3D11_INPUT_ELEMENT_DESC *elements, UINT num_elements, ID3D10Blob_ptr shader_code) |
Create input layout. | |
D3D11_INPUT_ELEMENT_DESC | tk11::make_input_element (DXGI_FORMAT format, const char *semantic_name, UINT semantic_index=0, UINT input_slot=0) |
Make input element. | |
template<typename T , std::size_t N> | |
D3D11_INPUT_ELEMENT_DESC | tk11::make_vector_input_element (const char *semantic_name, UINT semantic_index=0, UINT input_slot=0) |
Make vector-valued input element. | |
DXGI_FORMAT | tk11::Input_Element_Format::operator() () const |
Invocation operator. |
Helper functions for defining Direct3D input layouts.
ID3D11InputLayout_ptr tk11::create_input_layout | ( | ID3D11Device_ptr | device, | |
const D3D11_INPUT_ELEMENT_DESC * | elements, | |||
UINT | num_elements, | |||
ID3D10Blob_ptr | shader_code | |||
) |
Create input layout.
This helper function creates a Direct3D input layout. This requires an arrray of input element descriptions and a compiled vertex shader for verifying that the input layout matches the input signature of the shader.
Input element descriptions can be set up by make_input_element and related functions.
device | Interface of Direct3D device | |
elements | Array of input element descriptions | |
num_elements | Number of input element descriptions | |
shader_code | Interface of blob object holding shader code |
Direct3D_Error | Thrown if creation of input layout fails |
D3D11_INPUT_ELEMENT_DESC tk11::make_input_element | ( | DXGI_FORMAT | format, | |
const char * | semantic_name, | |||
UINT | semantic_index = 0 , |
|||
UINT | input_slot = 0 | |||
) |
Make input element.
Generic helper function for creating an input element description for an element of a vertex.
format | Format of element (e.g. DXGI_FORMAT_R32_FLOAT) | |
semantic_name | Semantic name of element (e.g. "POSITION") | |
semantic_index | Semantic index of element (e.g. 0 for "POSITION[0]") | |
input_slot | Input slot index |
D3D11_INPUT_ELEMENT_DESC tk11::make_vector_input_element | ( | const char * | semantic_name, | |
UINT | semantic_index = 0 , |
|||
UINT | input_slot = 0 | |||
) | [inline] |
Make vector-valued input element.
Creates an input element description for an element of a vertex which is of vector type. This template is specialized for different vector types.
semantic_name | Semantic name of element (e.g. "POSITION") | |
semantic_index | Semantic index of element (e.g. 0 for "POSITION[0]") | |
input_slot | Input slot index |
DXGI_FORMAT tk11::Input_Element_Format< T, N >::operator() | ( | ) | const [inherited] |
Invocation operator.