Add input layout

Add matrix buffer
Convert camera to D3D11
This commit is contained in:
2026-11-27 16:08:22 +01:00
parent 85d8830b84
commit 97192e1587
12 changed files with 171 additions and 69 deletions
+14
View File
@@ -1,9 +1,12 @@
#pragma once
#include <d3d11.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#pragma comment(lib, "d3dcompiler.lib")
using namespace DirectX;
class Material
{
public:
@@ -11,15 +14,26 @@ public:
void render(ID3D11DeviceContext* pD3DDeviceContext);
void deInit();
UINT setMatrices(ID3D11DeviceContext* pD3DDeviceContext,
const XMFLOAT4X4& worldMatrix, const XMFLOAT4X4& viewMatrix, const XMFLOAT4X4& projectionMatrix);
private:
UINT createVertexShader(ID3D11Device* pD3DDevice);
UINT createPixelShader(ID3D11Device* pD3DDevice);
UINT createInputLayout(ID3D11Device* pD3DDevice, ID3DBlob* pCompiledVertexShader);
UINT createMatrixBuffer(ID3D11Device* pD3DDevice);
ID3D11VertexShader* _pVertexShader = nullptr;
ID3D11PixelShader* _pPixelShader = nullptr;
ID3D11InputLayout* _pInputLayout = nullptr;
//IDirect3DTexture9* _pTexture = nullptr;
struct MatrixBuffer
{
XMFLOAT4X4 WorldViewProjectionMatrix;
};
ID3D11Buffer* _pMatrixBuffer = nullptr;
};