tk11::Mapped_Subresource Class Reference
[Buffers]

Scoped mapped subresource. More...

#include <buffer.hpp>

List of all members.

Public Member Functions

 Mapped_Subresource (ID3D11DeviceContext_ptr context, ID3D11Resource_ptr resource, UINT subresource=0, D3D11_MAP type=D3D11_MAP_WRITE_DISCARD)
 Blocking constructor.
 ~Mapped_Subresource ()
 Unmap subresource if it is mapped (destructor).
void map (D3D11_MAP type=D3D11_MAP_WRITE_DISCARD)
 Map the subresource.
void unmap ()
 Unmap the subresource.

Detailed Description

Scoped mapped subresource.

Helper class for mapping a subresource for accessing its data. This class calls ID3D11DeviceContext::Map and ID3D11DeviceContext::Unmap so that the subresource is mapped for the lifetime of an instance of this class. This is helpful for writing exception-safe code.


Constructor & Destructor Documentation

tk11::Mapped_Subresource::Mapped_Subresource ( ID3D11DeviceContext_ptr  context,
ID3D11Resource_ptr  resource,
UINT  subresource = 0,
D3D11_MAP  type = D3D11_MAP_WRITE_DISCARD 
)

Blocking constructor.

Maps the specified subresource. If the device is still rendering, then this constructor will block.

Parameters:
context Interface of device contex
resource Interface of resource to be mapped
subresource Index of subresource to be mapped
type Mapping type

Member Function Documentation

void tk11::Mapped_Subresource::map ( D3D11_MAP  type = D3D11_MAP_WRITE_DISCARD  ) 

Map the subresource.

The subresource must not be mapped already. If the device is still rendering, then this method will block.

Parameters:
type Type of mapping, see Direct3D11 documentation

The documentation for this class was generated from the following file:
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:02 2010 for Tk11 by  doxygen 1.6.3