Ejemplo n.º 1
0
//==============================================================================
GlBufferHandle::GlBufferHandle(GlCommandBufferHandle& commands,
                               GLenum target, PtrSize size, GLenum flags)
{
    ANKI_ASSERT(!isCreated());

    using Alloc = GlGlobalHeapAllocator<GlBuffer>;

    using DeleteCommand =
        GlDeleteObjectCommand<GlBuffer, GlGlobalHeapAllocator<U8>>;

    using Deleter = GlHandleDeferredDeleter<GlBuffer, Alloc, DeleteCommand>;

    *static_cast<Base::Base*>(this) = Base::Base(
                                          &commands._getQueue().getDevice(),
                                          commands._getQueue().getDevice()._getAllocator(),
                                          Deleter());
    _setState(GlHandleState::TO_BE_CREATED);

    // Fire the command
    commands._pushBackNewCommand<GlBufferCreateCommand>(
        *this, target, size, flags);
}