add mesh creation (WIP)

This commit is contained in:
2025-09-10 16:08:11 +02:00
parent 3bda921efb
commit 7aa8e8e79c
4 changed files with 34 additions and 0 deletions
+16
View File
@@ -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;
}