//
// Asura_Xbox360_VertexBuffer.h
//
// Created by KJFL - 05 October 2005
//
// Copyright (C) 2005 Rebellion, All Rights Reserved.
//

#if defined ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif

#if !defined __ASURA_XBOX360_VERTEXBUFFER_H__
#define __ASURA_XBOX360_VERTEXBUFFER_H__

/******************************************************************************/
/* Included Files                                                             */
/******************************************************************************/

#include "Core/Asura.h"

/******************************************************************************/
/* Classes                                                                    */
/******************************************************************************/

typedef struct IDirect3DVertexBuffer9 Direct3D_VertexBuffer;

////////////////////////////////////////////////////////////////////////////////
//
// Asura_Xbox360_VertexBuffer
//
// Class wrapping a vertex buffer on Xbox 360
//
////////////////////////////////////////////////////////////////////////////////

class Asura_Xbox360_VertexBuffer
{
public:

	// Constructor / destructor
	Asura_Xbox360_VertexBuffer();
	~Asura_Xbox360_VertexBuffer();

	// Functions

	void CreateStatic( const u_int uVertexSize, const u_int uNumberOfVertices,
		void* const pData = NULL, const u_int uDataOffset = 0 );

	void Destroy();

	void* Lock();
	void Unlock();

	void Bind( const u_int uStream = 0 ) const;

	bool IsEmpty() const;

private:

	// Data
	Direct3D_VertexBuffer*	m_pxBuffer;
	u_int					m_uVertexSize;
	bool					m_bManuallyManaged;
};

#endif // !defined __ASURA_XBOX360_VERTEXBUFFER_H__
