Changed D3D9 to D3D11 api connection

Changed mesh to D3D11
Changed material to D3D11 (WIP)
This commit is contained in:
2026-11-23 12:31:31 +01:00
parent abb8da9cff
commit 204c55e915
14 changed files with 288 additions and 182 deletions
+11 -8
View File
@@ -1,25 +1,28 @@
#pragma once
#include <d3d9.h>
#include <d3d11.h>
#include <DirectXMath.h>
using namespace DirectX;
class Mesh
{
public:
UINT init(IDirect3DDevice9* pD3DDevice);
UINT init(ID3D11Device* pD3DDevice);
void update(FLOAT dt);
void render(IDirect3DDevice9* pD3DDevice);
void render(ID3D11DeviceContext* pD3DDeviceContext);
void deInit();
private:
UINT createVertexBuffer(IDirect3DDevice9* pD3DDevice);
UINT createIndexBuffer(IDirect3DDevice9* pD3DDevice);
UINT createVertexBuffer(ID3D11Device* pD3DDevice);
UINT createIndexBuffer(ID3D11Device* pD3DDevice);
IDirect3DVertexBuffer9* _pVertexBuffer = nullptr; // dumps mesh vertices
IDirect3DIndexBuffer9* _pIndexBuffer = nullptr; // dumps mesh indices
ID3D11Buffer* _pVertexBuffer = nullptr; // dumps mesh vertices
ID3D11Buffer* _pIndexBuffer = nullptr; // dumps mesh indices
UINT _vertexCount = 0; // amount of vertices
UINT _vertexStride = 0; // size of one vertex in bytes
UINT _indexCount = 0; // amount of indices
D3DMATRIX _worldMatrix = {};
XMFLOAT4X4 _worldMatrix = {};
};