zengqh / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

D3D9 Mesh doesn't generate index buffer #317

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A user has reported that the D3D9 Mesh CreateXXX functions don't generate
indices for the index buffer.

See GDNet forum post:
http://www.gamedev.net/community/forums/topic.asp?topic_id=503900

Original issue reported on code.google.com by Mike.Popoloski on 7 Aug 2008 at 12:55

GoogleCodeExporter commented 9 years ago
I think I found the bug: in IndexBuffer::InitDescription() m_Description does 
not get
assigned.

void IndexBuffer::InitDescription()
{
    IndexBufferDescription desc;
    HRESULT hr = InternalPointer->GetDesc( reinterpret_cast<D3DINDEXBUFFER_DESC*>( &desc
) );
    RECORD_D3D9( hr );

    // ADD THE FOLLOWING LINE
    m_Description = desc;

    if( m_Description.Pool == Pool::Default )
        this->IsDefaultPool = true;
}

Original comment by m...@andreloker.de on 8 Aug 2008 at 12:13

GoogleCodeExporter commented 9 years ago
While we're here, should we switch index buffer over so that it's no longer 
caching
this stuff? iirc, it's the only buffer interface left that does.

Original comment by josh.petrie on 8 Aug 2008 at 3:33

GoogleCodeExporter commented 9 years ago
Fixed both IndexBuffer and VertexBuffer so that they don't cache the 
description anymore.

Original comment by Mike.Popoloski on 8 Aug 2008 at 4:08