add D3D11 project

This commit is contained in:
2025-11-19 09:43:09 +01:00
parent 9134d2dc40
commit bff01f5adb
36 changed files with 2779 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#include "Camera.h"
UINT Camera::init(UINT width, UINT height)
{
// view matrix
XMVECTOR position = XMVectorSet(0.0f, 0.0f, -1.0f, 0.0f);
XMVECTOR forward = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f);
XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f);
XMStoreFloat4x4(&_viewMatrix, XMMatrixLookToLH(position, forward, up));
// projection matrix
XMMATRIX perspectiveMatrix = XMMatrixPerspectiveFovLH(
XM_PI * 0.3333333f, // field of view in radians, here 60 degrees
static_cast<FLOAT>(width) / static_cast<FLOAT>(height), // aspect ratio
0.3f, 10.0f // near & far clipping planes
);
XMStoreFloat4x4(&_projectionMatrix, perspectiveMatrix);
return 0;
}
void Camera::update(FLOAT dt)
{
}
void Camera::deInit()
{
}