void DxSprite::DrawBatch(UINT startSpriteIndex, UINT spriteCount)
{
    D3D11_MAPPED_SUBRESOURCE mappedData;
    Globals::Get().device.m_context->Map(VB, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedData);

    SpriteVertex * v = reinterpret_cast<SpriteVertex *>(mappedData.pData);

    for(UINT i = 0; i < spriteCount; ++i)
    {
        const Sprite & sprite = SpriteList[startSpriteIndex + i];

        SpriteVertex quad[ 4 ];
        BuildSpriteQuad(sprite, quad);

        v[i * 4]     = quad[0];
        v[i * 4 + 1] = quad[1];
        v[i * 4 + 2] = quad[2];
        v[i * 4 + 3] = quad[3];
    }

    Globals::Get().device.m_context->Unmap(VB, 0);

    Globals::Get().device.m_context->DrawIndexed(spriteCount * 6, 0, 0);
}
void DX11SpriteBatch::DrawBatch(ID3D11DeviceContext* dc, u32 startSpriteIndex, u32 spriteCount)
{
	// Write the quads to the vertex buffer.
	D3D11_MAPPED_SUBRESOURCE mappedData;
	dc->Map(mVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedData);
	MeshData::SpriteVertex* v = reinterpret_cast<MeshData::SpriteVertex*>(mappedData.pData);

	for(u32 i = 0; i < spriteCount; ++i)
	{
		const Sprite& sprite = mSpriteList[startSpriteIndex + i];

		MeshData::SpriteVertex quad[4];
		BuildSpriteQuad(sprite, quad);

		v[i*4+0] = quad[0];
		v[i*4+1] = quad[1];
		v[i*4+2] = quad[2];
		v[i*4+3] = quad[3];
	}

	dc->Unmap(mVertexBuffer, 0);

	dc->DrawIndexed(spriteCount*6, 0, 0);
}