#include "xd3dindexbuffer.h"

XD3DIndexBuffer::XD3DIndexBuffer()
    : XD3DResource()
    , mAddress(0)
    , mSize(0)
{
    SetName("D3D Index Buffer");
}

void XD3DIndexBuffer::ParseData(XDataStream *aStream)
{
    XD3DResource::ParseData(aStream);

    *aStream >> mAddress;
    if (IsDebug())
    {
        qDebug() << QString("[%1] mAddress = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mAddress);
    }


    *aStream >> mSize;
    if (IsDebug())
    {
        qDebug() << QString("[%1] mSize = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mSize);
    }
}

void XD3DIndexBuffer::Clear()
{
    mAddress = 0;
    mSize = 0;
}
