Input Layouts
[Direct3D Utilities]

Collaboration diagram for Input Layouts:

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.

Detailed Description

Helper functions for defining Direct3D input layouts.


Function Documentation

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.

Parameters:
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
Returns:
Interface of input layout
Exceptions:
Direct3D_Error Thrown if creation of input layout fails
See also:
make_input_element, make_vector_input_element
Examples:
cube.cpp, input.cpp, and torus.cpp.
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.

Parameters:
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
Returns:
Input element description
See also:
create_input_layout, make_vector_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 
) [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.

Parameters:
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
Returns:
Input element description
See also:
create_input_layout, make_input_element
template<typename T , std::size_t N>
DXGI_FORMAT tk11::Input_Element_Format< T, N >::operator() (  )  const [inherited]

Invocation operator.

Returns:
Input element format
Tk11 Direct3D 11 Toolkit version 0.2 (SourceForge)
Copyright Florian Winter 2010 - 2010. Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Generated on Sun Apr 11 20:23:00 2010 for Tk11 by  doxygen 1.6.3