Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ jobs:
ref: ${{ github.base_ref }}
path: SleakCraft

- name: Point the game at this engine revision
run: |
rm -rf SleakCraft/Engine
ln -s ../SleakEngine SleakCraft/Engine

- name: Install dependencies
run: |
sudo apt-get update
Expand Down
6 changes: 3 additions & 3 deletions include/public/Math/Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ namespace Sleak
}

// Access elements (read/write)
[[nodiscard]] T& operator[](size_t index) {
[[nodiscard]] constexpr T& operator[](size_t index) {
assert(index < N && "Vector index out of range");
return data[index];
}

// Read-only access
[[nodiscard]] const T& operator[](size_t index) const {
[[nodiscard]] constexpr const T& operator[](size_t index) const {
assert(index < N && "Vector index out of range");
return data[index];
}

// Basic operations
Vector<T, N> operator+(const Vector<T, N>& other) const {
Vector<T, N> result;
Expand Down
14 changes: 14 additions & 0 deletions src/Graphics/DirectX11/DirectX11Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,21 @@ bool DirectX11Renderer::Initialize() {
&deviceContext // Device context
);

#ifdef _DEBUG
if (hr == DXGI_ERROR_SDK_COMPONENT_MISSING) {
SLEAK_WARN(
"D3D11 debug layer is not installed, creating device without it");
createDeviceFlags &= ~D3D11_CREATE_DEVICE_DEBUG;
hr = D3D11CreateDeviceAndSwapChain(
nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, createDeviceFlags,
featureLevels, 1, D3D11_SDK_VERSION, &swapChainDesc, &swapChain,
&device, nullptr, &deviceContext);
}
#endif

if (FAILED(hr)) {
SLEAK_ERROR("Failed to create device and swap chain! HRESULT: 0x{:X}",
(unsigned)hr);
return false;
}

Expand Down
Loading