"L. Spiro Engine"
|
Implements the interface specified by CVertexBufferBase for DirectX 11. More...
#include <LSGDirectX11VertexBuffer.h>
Classes | |
struct | LSG_DIRECTX11_LAST_VERT_DECLS |
struct | LSG_DIRECTX11_PREFINED_VERT_ATT |
Public Member Functions | |
LSE_INLINE D3D11_PRIMITIVE_TOPOLOGY LSE_CALL | GetDirectX11PrimitiveType () const |
Protected Types | |
typedef struct lsg::CDirectX11VertexBuffer::LSG_DIRECTX11_PREFINED_VERT_ATT * | LPLSG_DIRECTX11_PREFINED_VERT_ATT |
typedef struct lsg::CDirectX11VertexBuffer::LSG_DIRECTX11_PREFINED_VERT_ATT | LPCLSG_DIRECTX11_PREFINED_VERT_ATT |
typedef struct lsg::CDirectX11VertexBuffer::LSG_DIRECTX11_LAST_VERT_DECLS * | LPLSG_DIRECTX11_LAST_VERT_DECLS |
typedef struct lsg::CDirectX11VertexBuffer::LSG_DIRECTX11_LAST_VERT_DECLS | LPCLSG_DIRECTX11_LAST_VERT_DECLS |
Protected Member Functions | |
LSBOOL LSE_CALL | CreateApiVertexBuffer () |
LSVOID LSE_CALL | ResetApi () |
LSVOID LSE_CALL | UnLockApi () |
LSVOID LSE_CALL | AdjustInputsToApi (LSG_VB_CONTENTS &_vcContents, LSUINT16 &_ui16UsageAndAccess) |
LSUINT32 LSE_CALL | GetVertexAttributeSizeApi (const LSG_VB_CONTENTS &_vcContents) |
LSBOOL LSE_CALL | SetStreamApi (LSUINT32 _ui32Stream, LSUINT32 _ui32Offset, LSUINT32 _ui32ElementsSize) |
LSBOOL LSE_CALL | CanBufferBeDestroyedApi (LSUINT32 _ui32Elements, LSUINT32 _ui32ElementsSize, LSUINT32 _ui32UsageAndAccess) |
LSUINT32 LSE_CALL | RawColorToApiColor (LSREAL _fR, LSREAL _fG, LSREAL _fB, LSVOID *_pvBuffer) |
LSUINT32 LSE_CALL | RawColorToApiColor (LSREAL _fR, LSREAL _fG, LSREAL _fB, LSREAL _fA, LSVOID *_pvBuffer) |
LSVOID LSE_CALL | SetColorApi (LSREAL _fR, LSREAL _fG, LSREAL _fB, LSVOID *_pvBuffer) |
LSVOID LSE_CALL | SetAlphaApi (LSREAL _fA, LSVOID *_pvBuffer) |
LSVOID LSE_CALL | PrepareToRenderApi () |
LSVOID LSE_CALL | EndRenderApi () |
LSVOID LSE_CALL | RenderApi (LSUINT32 _ui32TotalPrimitives) |
LSUINT32 LSE_CALL | BestStrideApi (LSUINT32 _ui32Size) |
Protected Attributes | |
ID3D11Buffer * | m_pbApiVertexBuffer |
LSBOOL | m_bFakeAlpha [LSG_VBM_MAX_USAGES] |
LSUINT32 | m_ui32VertexDeclLength |
CVectorPoD < LSG_DIRECTX11_LAST_VERT_DECLS, LSUINT8, 1UL > | m_vVertDeclRecord |
D3D11_INPUT_ELEMENT_DESC * | m_piedVertexDeclaration |
D3D11_PRIMITIVE_TOPOLOGY | m_ptPrimitiveType |
Static Protected Attributes | |
static LSG_DIRECTX11_PREFINED_VERT_ATT | m_dpvaVertices [] |
Implements the interface specified by CVertexBufferBase for DirectX 11.
Class CDirectX11VertexBuffer Description: Implements the interface specified by CVertexBufferBase for DirectX 11. Note that only in debug builds is CVertexBufferBase actually inherited by this class.
typedef struct lsg::CDirectX11VertexBuffer::LSG_DIRECTX11_LAST_VERT_DECLS * lsg::CDirectX11VertexBuffer::LPLSG_DIRECTX11_LAST_VERT_DECLS [protected] |
Last-set vertex declarations for a given stream combination.
typedef struct lsg::CDirectX11VertexBuffer::LSG_DIRECTX11_PREFINED_VERT_ATT * lsg::CDirectX11VertexBuffer::LPLSG_DIRECTX11_PREFINED_VERT_ATT [protected] |
Vertex attribute properties.
LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::AdjustInputsToApi | ( | LSG_VB_CONTENTS & | _vcContents, |
LSUINT16 & | _ui16UsageAndAccess | ||
) | [protected] |
Give the current graphics API vertex buffer a chance to adjust some of the inputs when creating a vertex buffer. For example, OpenGL allows colors to be specified without alpha, whereas DirectX always has alpha when there are colors specified. Using this function, DirectX can magically add the alpha flag when the color flag is specified.
_vcContents | The vertex attributes. |
_ui16UsageAndAccess | The usage and access value. |
LSUINT32 LSE_CALL lsg::CDirectX11VertexBuffer::BestStrideApi | ( | LSUINT32 | _ui32Size | ) | [protected] |
Determines the best stride for a vertex buffer given its element size.
_ui32Size |
LSBOOL LSE_CALL lsg::CDirectX11VertexBuffer::CanBufferBeDestroyedApi | ( | LSUINT32 | _ui32Elements, |
LSUINT32 | _ui32ElementsSize, | ||
LSUINT32 | _ui32UsageAndAccess | ||
) | [protected] |
Can the source vertex data be destroyed? This is guaranteed to be called only after a successful call to CreateApiVertexBuffer().
_ui32Elements | The number of elements in the buffer to be potentially destroyed. |
_ui32ElementsSize | The size of the elements in the buffer to be potentially destroyed. |
_ui32UsageAndAccess | The usage and access of the buffer to be potentially destroyed. |
LSBOOL LSE_CALL lsg::CDirectX11VertexBuffer::CreateApiVertexBuffer | ( | ) | [protected] |
Create a vertex buffer compliant with the current graphics API.
LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::EndRenderApi | ( | ) | [protected] |
Finish rendering.
LSE_INLINE D3D11_PRIMITIVE_TOPOLOGY LSE_CALL lsg::CDirectX11VertexBuffer::GetDirectX11PrimitiveType | ( | ) | const |
Get the primitive type in DirectX 11 terms.
LSUINT32 LSE_CALL lsg::CDirectX11VertexBuffer::GetVertexAttributeSizeApi | ( | const LSG_VB_CONTENTS & | _vcContents | ) | [protected] |
Given a contents mask, determine the size of a single vertex attribute in bytes.
_vcContents | Mask indicating the contents of a vertex. |
LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::PrepareToRenderApi | ( | ) | [protected] |
Prepare for rendering.
LSE_INLINE LSUINT32 LSE_CALL lsg::CDirectX11VertexBuffer::RawColorToApiColor | ( | LSREAL | _fR, |
LSREAL | _fG, | ||
LSREAL | _fB, | ||
LSVOID * | _pvBuffer | ||
) | [protected] |
Translate a color from 3 floats to the internal format used by the graphics API.
_fR | The red component of the color to translate. |
_fG | The green component of the color to translate. |
_fB | The blue component of the color to translate. |
_pvBuffer | The location where to store the color. |
LSE_INLINE LSUINT32 LSE_CALL lsg::CDirectX11VertexBuffer::RawColorToApiColor | ( | LSREAL | _fR, |
LSREAL | _fG, | ||
LSREAL | _fB, | ||
LSREAL | _fA, | ||
LSVOID * | _pvBuffer | ||
) | [protected] |
Translate a color from 4 floats to the internal format used by the graphics API.
_fR | The red component of the color to translate. |
_fG | The green component of the color to translate. |
_fB | The blue component of the color to translate. |
_fA | The alpha component of the color to translate. |
_pvBuffer | The location where to store the color. |
LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::RenderApi | ( | LSUINT32 | _ui32TotalPrimitives | ) | [protected] |
Render. This is performed on the first vertex buffer set. All other vertex buffers must use the same primitive type and have the same number of elements active. If not, the system will throw an error.
_ui32TotalPrimitives | The total number of primitives to render. |
LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::ResetApi | ( | ) | [protected] |
Destroy the vertex buffer that is compliant with the current graphics API and all related resources.
LSE_INLINE LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::SetAlphaApi | ( | LSREAL | _fA, |
LSVOID * | _pvBuffer | ||
) | [protected] |
Apply a given alpha to the given vertex buffer location.
_fA | The alpha component of the color to set. |
_pvBuffer | The location on the vertex buffer where to store the alpha. |
LSE_INLINE LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::SetColorApi | ( | LSREAL | _fR, |
LSREAL | _fG, | ||
LSREAL | _fB, | ||
LSVOID * | _pvBuffer | ||
) | [protected] |
Apply a given color to the given vertex buffer location.
_fR | The red component of the color to set. |
_fG | The green component of the color to set. |
_fB | The blue component of the color to set. |
_pvBuffer | The location on the vertex buffer where to store the color. |
LSBOOL LSE_CALL lsg::CDirectX11VertexBuffer::SetStreamApi | ( | LSUINT32 | _ui32Stream, |
LSUINT32 | _ui32Offset, | ||
LSUINT32 | _ui32ElementsSize | ||
) | [protected] |
Activate this vertex buffer on a given stream.
_ui32Stream | The stream on which to activate this buffer. |
_ui32Offset | The offset, in elements. |
_ui32ElementsSize | Size of the elements in the vertex buffer. |
LSVOID LSE_CALL lsg::CDirectX11VertexBuffer::UnLockApi | ( | ) | [protected] |
Updates the hardware with the modified vertex buffer data.
LSBOOL lsg::CDirectX11VertexBuffer::m_bFakeAlpha[LSG_VBM_MAX_USAGES] [protected] |
Do we fake the alpha values?
LSG_DIRECTX11_PREFINED_VERT_ATT lsg::CDirectX11VertexBuffer::m_dpvaVertices[] [static, protected] |
Vertex attributes.
ID3D11Buffer* lsg::CDirectX11VertexBuffer::m_pbApiVertexBuffer [protected] |
A DirectX 11 vertex buffer.
D3D11_INPUT_ELEMENT_DESC* lsg::CDirectX11VertexBuffer::m_piedVertexDeclaration [protected] |
Vertex declaration.
D3D11_PRIMITIVE_TOPOLOGY lsg::CDirectX11VertexBuffer::m_ptPrimitiveType [protected] |
DirectX 11 primitive type.
LSUINT32 lsg::CDirectX11VertexBuffer::m_ui32VertexDeclLength [protected] |
Total values in our vertex declaration.
CVectorPoD<LSG_DIRECTX11_LAST_VERT_DECLS, LSUINT8, 1UL> lsg::CDirectX11VertexBuffer::m_vVertDeclRecord [protected] |
An array of up to LSG_VBM_MAX_STREAMS entries to record the last-set vertex declarations for each slot combination.