Skip to content

LiteFX::Rendering::GraphicsFactory::tryCreateIndexBuffer

Tries to create an index buffer, based on the layout.

Synopses

Declared in <litefx/rendering.hpp>

Tries to create an index buffer, based on the layout.

[[dllimport, dllexport]] bool tryCreateIndexBuffer(
    SharedPtr<IIndexBuffer>& buffer,
    IIndexBufferLayout const& layout,
    ResourceHeap heap,
    UInt32 elements,
    ResourceUsage usage = ResourceUsage::Default,
    AllocationBehavior allocationBehavior = AllocationBehavior::Default) const;

» more...

Tries to create an index buffer, based on the layout.

virtual bool tryCreateIndexBuffer(
    SharedPtr<TIndexBuffer>& buffer,
    index_buffer_layout_type const& layout,
    ResourceHeap heap,
    UInt32 elements,
    ResourceUsage usage = ResourceUsage::Default,
    AllocationBehavior allocationBehavior = AllocationBehavior::Default) const = 0;

» more...

Tries to create an index buffer, based on the layout.

[[dllimport, dllexport]] bool tryCreateIndexBuffer(
    SharedPtr<IIndexBuffer>& buffer,
    String const& name,
    IIndexBufferLayout const& layout,
    ResourceHeap heap,
    UInt32 elements,
    ResourceUsage usage = ResourceUsage::Default,
    AllocationBehavior allocationBehavior = AllocationBehavior::Default) const;

» more...

Tries to create an index buffer, based on the layout.

virtual bool tryCreateIndexBuffer(
    SharedPtr<TIndexBuffer>& buffer,
    String const& name,
    index_buffer_layout_type const& layout,
    ResourceHeap heap,
    UInt32 elements,
    ResourceUsage usage = ResourceUsage::Default,
    AllocationBehavior allocationBehavior = AllocationBehavior::Default) const = 0;

» more...

Return Value

true, if the buffer was created successfully and false otherwise.

Parameters

NameDescription
bufferThe instance of the buffer, or nullptr, if the buffer could not be allocated.
layoutThe layout of the index buffer.
heapThe heap to allocate the buffer on.
elementsThe number of elements within the vertex buffer (i.e. the number of indices).
usageThe intended usage for the buffer.
allocationBehaviorThe behavior controlling what happens if currently there is not enough memory available for the resource.
nameThe name of the buffer.