add mesh creation (WIP)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "Mesh.h"
|
||||
#include "Utilities.h"
|
||||
#include "Vertex.h"
|
||||
|
||||
UINT Mesh::init(IDirect3DDevice9* pD3DDevice)
|
||||
{
|
||||
@@ -30,6 +31,21 @@ void Mesh::deInit()
|
||||
|
||||
UINT Mesh::createVertexBuffer(IDirect3DDevice9* pD3DDevice)
|
||||
{
|
||||
// 1. define mesh structure
|
||||
_vertexCount = 3;
|
||||
_vertexStride = sizeof(Vertex);
|
||||
|
||||
// 2. create vertex buffer WITHOUT data
|
||||
HRESULT hr = pD3DDevice->CreateVertexBuffer(
|
||||
_vertexCount * _vertexStride, // vertex buffer byte length
|
||||
D3DUSAGE_WRITEONLY, // vertex buffer access mode
|
||||
FVF, // FVF - Flexible Vertex Format
|
||||
D3DPOOL_MANAGED, // video memory management
|
||||
&_pVertexBuffer,
|
||||
nullptr // not used anymore
|
||||
);
|
||||
|
||||
// 3. fill vertex buffer with data
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user