#ifndef DX8_VERTEXBUFFER_H
#define DX8_VERTEXBUFFER_H



#include <windows.h>
#include <d3dx8.h>
#include <vector>



class CVertexBuffer
{

  public:

    typedef std::vector<IDirect3DVertexBuffer8*>    tVectVertexBuffers;

    tVectVertexBuffers            m_vectVertexBuffers;

    D3DPRIMITIVETYPE              m_d3dPrimType;

    DWORD                         m_dwPrimitiveCount,
                                  m_dwPrimitiveSize,
                                  m_dwPrimitivePartCount,
                                  m_dwCompleteBufferSize,

                                  m_dwUsage,
                                  m_dwFVF;

    D3DPOOL                       m_d3dPool;

    void*                         m_pData;



    CVertexBuffer()
      : m_d3dPrimType( D3DPT_TRIANGLELIST ),
        m_dwPrimitiveCount( 0 ),
        m_dwPrimitiveSize( 0 ),
        m_dwPrimitivePartCount( 0 ),
        m_dwCompleteBufferSize( 0 ),
        m_dwFVF( 0 ),
        m_pData( NULL )
    {
    }

    virtual ~CVertexBuffer();

    virtual bool                  CreateBuffers( LPDIRECT3DDEVICE8 pd3dDevice );

    virtual void                  Invalidate();

    virtual BOOL                  Restore( LPDIRECT3DDEVICE8 pd3dDevice );

    // kopiert die Daten aus dem gespeicherten Puffer in die Karte
    virtual void                  UpdateData();

    bool                          SetData( void* pData );

    bool                          Display( LPDIRECT3DDEVICE8 pd3dDevice, DWORD dwIndex = 0, DWORD dwCount = 0 );


};


#endif