SPtr<VertexDeclaration> HardwareBufferManager::createVertexDeclaration(const SPtr<VertexDataDesc>& desc, 
		GpuDeviceFlags deviceMask)
	{
		Vector<VertexElement> elements = desc->createElements();

		return createVertexDeclaration(elements, deviceMask);
	}
void VertexInfoFactory::generateVertexDeclaration()
{
	for ( u32 i = 0; i < u32( EVT_VERTEX_MAX ); i ++ )
	{
		if ( !mpVDecl[ i ] )
			SAFE_RELEASE( mpVDecl[ i ] );
		
		createVertexDeclaration( EVUT_DIRECT3D9, static_cast< E_VERTEX_TYPE >( i ) );
	}
}
Beispiel #3
0
SilhouetteEdges::SilhouetteEdges(IDirect3DDevice9* device,
								 ID3DXMesh* mesh, 
								 ID3DXBuffer* adjBuffer)
{
	_device   = device;
	_vb       = 0;
	_ib       = 0;
	_decl     = 0;
	_numVerts = 0;
	_numFaces = 0;

	genEdgeVertices(mesh, adjBuffer);
	genEdgeIndices(mesh);
	createVertexDeclaration();
}
void DynamicRenderable::initialize( RenderOperation::OperationType operationType, bool useIndices)
{
	// Initialize render operation
	mRenderOp.operationType = operationType;
	mRenderOp.useIndexes = useIndices;
	mRenderOp.vertexData = new VertexData;
	if (mRenderOp.useIndexes)
	mRenderOp.indexData = new IndexData;

	// Reset buffer capacities
	mVertexBufferCapacity = 0;
	mIndexBufferCapacity = 0;

	// Create vertex declaration
	createVertexDeclaration();
}