From 4d2dfce31c23929b56c6536487e5be3bc4106110 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20H=C3=A5kansson?=
<34460034+Thraix@users.noreply.github.com>
Date: Sat, 9 Aug 2025 21:42:15 +0200
Subject: [PATCH] Add Linux support
- Add linux build system using MakeGen
- Fix a swapchain validation error, likelydue to my linux system using a
different vulkan version
- Make DescriptorPool take in amount of descriptors it needs, instead of
allocating a mass amount for every pool, causing loads of RAM/VRAM usage
---
.gitignore | 2 +
CopiumEngine/makegen.xml | 53 +++++++++++++++++++
CopiumEngine/src/copium/asset/Asset.h | 1 -
CopiumEngine/src/copium/asset/AssetFile.cpp | 4 +-
CopiumEngine/src/copium/asset/AssetFile.h | 3 +-
.../src/copium/asset/AssetManager.cpp | 5 +-
CopiumEngine/src/copium/buffer/Framebuffer.h | 3 +-
.../src/copium/buffer/IndexBuffer.cpp | 6 ++-
.../src/copium/buffer/UniformBuffer.cpp | 2 +-
.../src/copium/core/DebugMessenger.cpp | 4 +-
CopiumEngine/src/copium/core/Device.cpp | 1 +
CopiumEngine/src/copium/core/Device.h | 5 +-
.../src/copium/core/ImGuiInstance.cpp | 4 +-
CopiumEngine/src/copium/core/Instance.cpp | 5 +-
CopiumEngine/src/copium/core/Instance.h | 3 --
CopiumEngine/src/copium/core/SwapChain.cpp | 22 +++++---
CopiumEngine/src/copium/core/SwapChain.h | 4 +-
CopiumEngine/src/copium/core/Vulkan.cpp | 11 +++-
CopiumEngine/src/copium/core/Vulkan.h | 5 +-
CopiumEngine/src/copium/core/Window.cpp | 7 +--
CopiumEngine/src/copium/core/Window.h | 2 +-
.../src/copium/ecs/ComponentListener.h | 4 +-
CopiumEngine/src/copium/ecs/ECSManager.h | 3 +-
CopiumEngine/src/copium/ecs/System.h | 3 +-
CopiumEngine/src/copium/ecs/SystemBase.h | 2 +
CopiumEngine/src/copium/ecs/SystemOrderer.h | 2 -
CopiumEngine/src/copium/ecs/SystemPool.cpp | 2 +
CopiumEngine/src/copium/event/Event.h | 2 +
CopiumEngine/src/copium/event/Input.cpp | 3 +-
CopiumEngine/src/copium/event/Input.h | 4 +-
CopiumEngine/src/copium/event/InputCode.h | 4 +-
.../src/copium/event/MousePressEvent.cpp | 2 +-
.../src/copium/event/MouseReleaseEvent.cpp | 2 +-
.../src/copium/event/ViewportResize.h | 1 -
CopiumEngine/src/copium/mesh/Vertex.h | 2 +-
.../src/copium/mesh/VertexPassthrough.h | 2 +-
.../src/copium/pipeline/DescriptorPool.cpp | 27 +++++++---
.../src/copium/pipeline/DescriptorPool.h | 3 +-
.../src/copium/pipeline/DescriptorSet.h | 3 +-
CopiumEngine/src/copium/pipeline/Pipeline.cpp | 9 ++--
CopiumEngine/src/copium/pipeline/Pipeline.h | 4 +-
.../src/copium/pipeline/PipelineCreator.cpp | 2 +-
.../src/copium/pipeline/PipelineCreator.h | 1 +
.../src/copium/pipeline/ShaderBinding.h | 1 +
CopiumEngine/src/copium/renderer/Batch.cpp | 5 +-
CopiumEngine/src/copium/renderer/Batch.h | 4 +-
.../src/copium/renderer/LineRenderer.cpp | 10 ++--
.../src/copium/renderer/LineRenderer.h | 2 -
CopiumEngine/src/copium/renderer/Renderer.cpp | 18 +++----
CopiumEngine/src/copium/renderer/Renderer.h | 7 +--
.../src/copium/sampler/DepthAttachment.h | 1 -
CopiumEngine/src/copium/sampler/Font.cpp | 5 +-
.../src/copium/sampler/SamplerCreator.h | 1 +
CopiumEngine/src/copium/sampler/Texture2D.cpp | 2 -
CopiumEngine/src/copium/util/BoundingBox.cpp | 16 ++++--
CopiumEngine/src/copium/util/BoundingBox.h | 13 ++---
CopiumEngine/src/copium/util/Common.h | 40 ++++++++------
CopiumEngine/src/copium/util/Enum.h | 3 +-
CopiumEngine/src/copium/util/FileSystem.cpp | 7 ++-
CopiumEngine/src/copium/util/FileSystem.h | 8 ++-
.../src/copium/util/RuntimeException.cpp | 6 +--
.../src/copium/util/RuntimeException.h | 4 +-
CopiumEngine/src/copium/util/StringUtil.h | 1 -
CopiumEngine/src/copium/util/Timer.cpp | 4 +-
.../src/copium/util/VulkanException.h | 2 +-
ext/projects/imgui/makegen.xml | 41 ++++++++++++++
ext/projects/msdf-atlas-gen/makegen.xml | 33 ++++++++++++
ext/projects/msdfgen-core/makegen.xml | 31 +++++++++++
ext/projects/msdfgen-ext/makegen.xml | 37 +++++++++++++
69 files changed, 389 insertions(+), 152 deletions(-)
create mode 100644 CopiumEngine/makegen.xml
create mode 100644 ext/projects/imgui/makegen.xml
create mode 100644 ext/projects/msdf-atlas-gen/makegen.xml
create mode 100644 ext/projects/msdfgen-core/makegen.xml
create mode 100644 ext/projects/msdfgen-ext/makegen.xml
diff --git a/.gitignore b/.gitignore
index 1b7975a..27f8f63 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,5 @@ bin/
.cache
libs
imgui.ini
+Makefile
+compile_flags.txt
diff --git a/CopiumEngine/makegen.xml b/CopiumEngine/makegen.xml
new file mode 100644
index 0000000..565e3c9
--- /dev/null
+++ b/CopiumEngine/makegen.xml
@@ -0,0 +1,53 @@
+
+
+ MSDF_ATLAS_PUBLIC=
+ GLM_FORCE_LEFT_HANDED
+ GLM_FORCE_RADIANS
+ GLM_FORCE_DEPTH_ZERO_TO_ONE
+ ../ext/projects/imgui/
+ ../ext/projects/msdf-atlas-gen/
+ ../ext/projects/msdfgen-core/
+ ../ext/projects/msdfgen-ext/
+ false
+ bin/Release/
+ libcopium.so
+ sharedlibrary
+ Copium Engine
+ src/
+ src/
+ ../ext/repos/imgui/
+ ../ext/repos/imgui/backends/
+ ../ext/repos/freetype/
+ ../ext/repos/msdf-atlas-gen/msdfgen/
+ ../ext/repos/msdf-atlas-gen/
+ ../ext/repos/stb/
+
+
+ -g3
+ -w
+ _DEBUG
+ MSDF_ATLAS_PUBLIC=
+ GLM_FORCE_LEFT_HANDED
+ GLM_FORCE_RADIANS
+ GLM_FORCE_DEPTH_ZERO_TO_ONE
+ ../ext/projects/imgui/
+ ../ext/projects/msdf-atlas-gen/
+ ../ext/projects/msdfgen-core/
+ ../ext/projects/msdfgen-ext/
+ false
+ bin/Debug/
+ libcopium.so
+ sharedlibrary
+ Copium Engine
+ src/
+ src/
+ ../ext/repos/imgui/
+ ../ext/repos/imgui/backends/
+ ../ext/repos/freetype/
+ ../ext/repos/msdf-atlas-gen/msdfgen/
+ ../ext/repos/msdf-atlas-gen/
+ ../ext/repos/stb/
+
+ Debug
+ v1.3.4
+
diff --git a/CopiumEngine/src/copium/asset/Asset.h b/CopiumEngine/src/copium/asset/Asset.h
index 38a5141..bd42544 100644
--- a/CopiumEngine/src/copium/asset/Asset.h
+++ b/CopiumEngine/src/copium/asset/Asset.h
@@ -1,7 +1,6 @@
#pragma once
#include "copium/asset/AssetMeta.h"
-#include "copium/util/MetaFile.h"
#include "copium/util/Uuid.h"
#include
diff --git a/CopiumEngine/src/copium/asset/AssetFile.cpp b/CopiumEngine/src/copium/asset/AssetFile.cpp
index 6b126b3..10c7cec 100644
--- a/CopiumEngine/src/copium/asset/AssetFile.cpp
+++ b/CopiumEngine/src/copium/asset/AssetFile.cpp
@@ -17,7 +17,7 @@ namespace Copium
return dateModified < FileSystem::DateModified(path);
}
- void AssetFile::Load()
+ void AssetFile::Load()
{
MetaFile metaFile{path};
for (auto&& assetType : assetTypes)
@@ -52,4 +52,4 @@ namespace Copium
{
assetTypes.emplace_back(assetType);
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/asset/AssetFile.h b/CopiumEngine/src/copium/asset/AssetFile.h
index 5506b54..4ffb6e2 100644
--- a/CopiumEngine/src/copium/asset/AssetFile.h
+++ b/CopiumEngine/src/copium/asset/AssetFile.h
@@ -1,6 +1,5 @@
#pragma once
-#include "copium/asset/AssetMeta.h"
#include "copium/util/MetaFile.h"
#include "copium/util/Uuid.h"
@@ -27,4 +26,4 @@ namespace Copium
void Load(const MetaFile& metaFile, const std::string& className);
static void RegisterAssetType(const std::string& assetType);
};
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/asset/AssetManager.cpp b/CopiumEngine/src/copium/asset/AssetManager.cpp
index 8301b8d..d3712f4 100644
--- a/CopiumEngine/src/copium/asset/AssetManager.cpp
+++ b/CopiumEngine/src/copium/asset/AssetManager.cpp
@@ -1,8 +1,5 @@
#include "copium/asset/AssetManager.h"
-#include "copium/buffer/Framebuffer.h"
-#include "copium/sampler/ColorAttachment.h"
-#include "copium/sampler/Texture2D.h"
#include "copium/util/Common.h"
#include "copium/util/MetaFile.h"
@@ -185,4 +182,4 @@ namespace Copium
}
CP_ABORT("Unknown Asset type: %s", filepath.c_str());
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/buffer/Framebuffer.h b/CopiumEngine/src/copium/buffer/Framebuffer.h
index 92cb9b2..c3b874b 100644
--- a/CopiumEngine/src/copium/buffer/Framebuffer.h
+++ b/CopiumEngine/src/copium/buffer/Framebuffer.h
@@ -1,7 +1,6 @@
#pragma once
#include "copium/asset/Asset.h"
-#include "copium/asset/AssetMeta.h"
#include "copium/asset/AssetRef.h"
#include "copium/buffer/CommandBuffer.h"
#include "copium/sampler/ColorAttachment.h"
@@ -44,4 +43,4 @@ namespace Copium
void InitializeRenderPass();
void InitializeFramebuffers();
};
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/buffer/IndexBuffer.cpp b/CopiumEngine/src/copium/buffer/IndexBuffer.cpp
index e65214e..8212837 100644
--- a/CopiumEngine/src/copium/buffer/IndexBuffer.cpp
+++ b/CopiumEngine/src/copium/buffer/IndexBuffer.cpp
@@ -5,7 +5,9 @@
namespace Copium
{
IndexBuffer::IndexBuffer(int indexCount)
- : Buffer{VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, indexCount * sizeof(uint16_t), 1},
+ : Buffer{VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
+ indexCount * sizeof(uint16_t), 1},
indexCount{indexCount}
{}
@@ -24,4 +26,4 @@ namespace Copium
CP_ASSERT(indices >= 0 && indices <= indexCount, "amount of indices is out of range");
vkCmdDrawIndexed(commandBuffer, indices, 1, 0, 0, 0);
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/buffer/UniformBuffer.cpp b/CopiumEngine/src/copium/buffer/UniformBuffer.cpp
index c3c47db..f8b869a 100644
--- a/CopiumEngine/src/copium/buffer/UniformBuffer.cpp
+++ b/CopiumEngine/src/copium/buffer/UniformBuffer.cpp
@@ -84,4 +84,4 @@ namespace Copium
Buffer::Update(buffer.data(), i);
}
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/core/DebugMessenger.cpp b/CopiumEngine/src/copium/core/DebugMessenger.cpp
index 5d38978..d4c9621 100644
--- a/CopiumEngine/src/copium/core/DebugMessenger.cpp
+++ b/CopiumEngine/src/copium/core/DebugMessenger.cpp
@@ -53,7 +53,7 @@ namespace Copium
VKAPI_ATTR VkBool32 VKAPI_CALL DebugMessenger::DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageType,
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
- void* pUserData)
+ void* pUserData)
{
if (messageSeverity >= VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT)
{
@@ -85,4 +85,4 @@ namespace Copium
}
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/core/Device.cpp b/CopiumEngine/src/copium/core/Device.cpp
index b872529..1c13708 100644
--- a/CopiumEngine/src/copium/core/Device.cpp
+++ b/CopiumEngine/src/copium/core/Device.cpp
@@ -1,5 +1,6 @@
#include "Device.h"
+#include "copium/core/QueueFamilies.h"
#include "copium/core/Vulkan.h"
#include "copium/core/Window.h"
diff --git a/CopiumEngine/src/copium/core/Device.h b/CopiumEngine/src/copium/core/Device.h
index baab080..8ae9741 100644
--- a/CopiumEngine/src/copium/core/Device.h
+++ b/CopiumEngine/src/copium/core/Device.h
@@ -1,6 +1,5 @@
#pragma once
-#include "copium/core/QueueFamilies.h"
#include "copium/util/Common.h"
#include
@@ -16,7 +15,7 @@ namespace Copium
public:
Device();
~Device();
-
+
uint32_t GetGraphicsQueueFamily() const;
uint32_t GetPresentQueueFamily() const;
VkQueue GetGraphicsQueue() const;
@@ -51,4 +50,4 @@ namespace Copium
bool CheckDeviceExtensionSupport(VkPhysicalDevice device);
std::vector GetRequiredDeviceExtensions();
};
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/core/ImGuiInstance.cpp b/CopiumEngine/src/copium/core/ImGuiInstance.cpp
index 695ba59..6fa84b6 100644
--- a/CopiumEngine/src/copium/core/ImGuiInstance.cpp
+++ b/CopiumEngine/src/copium/core/ImGuiInstance.cpp
@@ -10,7 +10,7 @@
namespace Copium
{
ImGuiInstance::ImGuiInstance()
- : descriptorPool{std::make_unique()}
+ : descriptorPool{std::make_unique(SwapChain::MAX_FRAMES_IN_FLIGHT, 1)}
{
InitializeImGui();
InitializeDescriptorSetLayout();
@@ -109,4 +109,4 @@ namespace Copium
{
CP_VK_ASSERT(err, "Failed to initialize ImGui");
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/core/Instance.cpp b/CopiumEngine/src/copium/core/Instance.cpp
index 2d26755..392cc59 100644
--- a/CopiumEngine/src/copium/core/Instance.cpp
+++ b/CopiumEngine/src/copium/core/Instance.cpp
@@ -1,8 +1,9 @@
#include "Instance.h"
-#include "copium/core/QueueFamilies.h"
#include "copium/util/Common.h"
+#include
+
namespace Copium
{
Instance::Instance(const std::string& applicationName)
@@ -107,4 +108,4 @@ namespace Copium
}
return true;
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/core/Instance.h b/CopiumEngine/src/copium/core/Instance.h
index e004ef1..a177d2d 100644
--- a/CopiumEngine/src/copium/core/Instance.h
+++ b/CopiumEngine/src/copium/core/Instance.h
@@ -2,9 +2,6 @@
#include "copium/core/DebugMessenger.h"
-#include
-#include
-
namespace Copium
{
class Instance final
diff --git a/CopiumEngine/src/copium/core/SwapChain.cpp b/CopiumEngine/src/copium/core/SwapChain.cpp
index 63b9053..c68f3bc 100644
--- a/CopiumEngine/src/copium/core/SwapChain.cpp
+++ b/CopiumEngine/src/copium/core/SwapChain.cpp
@@ -4,10 +4,10 @@
#include "copium/core/Vulkan.h"
#include "copium/sampler/Image.h"
-#include
-
namespace Copium
{
+ const int SwapChain::MAX_FRAMES_IN_FLIGHT = 2;
+
SwapChainSupportDetails::SwapChainSupportDetails(VkSurfaceKHR surface, VkPhysicalDevice physicalDevice)
{
vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, &capabilities);
@@ -35,6 +35,7 @@ namespace Copium
}
SwapChain::SwapChain()
+ : flightIndex{0}, resizeFramebuffer{false}
{
Initialize();
InitializeImageViews();
@@ -49,9 +50,13 @@ namespace Copium
for (size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; ++i)
{
vkDestroyFence(Vulkan::GetDevice(), inFlightFences[i], nullptr);
- vkDestroySemaphore(Vulkan::GetDevice(), renderFinishedSemaphores[i], nullptr);
vkDestroySemaphore(Vulkan::GetDevice(), imageAvailableSemaphores[i], nullptr);
}
+ for (size_t i = 0; i < images.size(); ++i)
+ {
+ vkDestroySemaphore(Vulkan::GetDevice(), renderFinishedSemaphores[i], nullptr);
+ }
+
Destroy();
vkDestroyRenderPass(Vulkan::GetDevice(), renderPass, nullptr);
}
@@ -137,7 +142,7 @@ namespace Copium
submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &cmd;
submitInfo.signalSemaphoreCount = 1;
- submitInfo.pSignalSemaphores = &renderFinishedSemaphores[flightIndex];
+ submitInfo.pSignalSemaphores = &renderFinishedSemaphores[imageIndex];
CP_VK_ASSERT(vkQueueSubmit(Vulkan::GetDevice().GetGraphicsQueue(), 1, &submitInfo, inFlightFences[flightIndex]), "Failed to submit command buffer");
}
@@ -147,7 +152,7 @@ namespace Copium
VkPresentInfoKHR presentInfo{};
presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
presentInfo.waitSemaphoreCount = 1;
- presentInfo.pWaitSemaphores = &renderFinishedSemaphores[flightIndex];
+ presentInfo.pWaitSemaphores = &renderFinishedSemaphores[imageIndex];
presentInfo.swapchainCount = 1;
presentInfo.pSwapchains = &handle;
presentInfo.pImageIndices = &imageIndex;
@@ -345,14 +350,12 @@ namespace Copium
void SwapChain::InitializeSyncObjects()
{
imageAvailableSemaphores.resize(MAX_FRAMES_IN_FLIGHT);
- renderFinishedSemaphores.resize(MAX_FRAMES_IN_FLIGHT);
inFlightFences.resize(MAX_FRAMES_IN_FLIGHT);
VkSemaphoreCreateInfo semaphoreCreateInfo{};
semaphoreCreateInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
for (size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; ++i)
{
CP_VK_ASSERT(vkCreateSemaphore(Vulkan::GetDevice(), &semaphoreCreateInfo, nullptr, &imageAvailableSemaphores[i]), "Failed to initialize available image semaphore");
- CP_VK_ASSERT(vkCreateSemaphore(Vulkan::GetDevice(), &semaphoreCreateInfo, nullptr, &renderFinishedSemaphores[i]), "Failed to initialize render finished semaphore");
VkFenceCreateInfo fenceCreateInfo{};
fenceCreateInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
@@ -360,6 +363,11 @@ namespace Copium
CP_VK_ASSERT(vkCreateFence(Vulkan::GetDevice(), &fenceCreateInfo, nullptr, &inFlightFences[i]), "Failed to initialize in flight fence");
}
+ renderFinishedSemaphores.resize(images.size());
+ for(size_t i = 0; i < renderFinishedSemaphores.size(); i++)
+ {
+ CP_VK_ASSERT(vkCreateSemaphore(Vulkan::GetDevice(), &semaphoreCreateInfo, nullptr, &renderFinishedSemaphores[i]), "Failed to initialize render finished semaphore");
+ }
}
void SwapChain::Destroy()
diff --git a/CopiumEngine/src/copium/core/SwapChain.h b/CopiumEngine/src/copium/core/SwapChain.h
index 3449625..f8e7df1 100644
--- a/CopiumEngine/src/copium/core/SwapChain.h
+++ b/CopiumEngine/src/copium/core/SwapChain.h
@@ -24,7 +24,7 @@ namespace Copium
{
CP_DELETE_COPY_AND_MOVE_CTOR(SwapChain);
public:
- static const int MAX_FRAMES_IN_FLIGHT = 2;
+ static const int MAX_FRAMES_IN_FLIGHT;
private:
VkSwapchainKHR handle;
VkRenderPass renderPass;
@@ -34,7 +34,7 @@ namespace Copium
std::vector imageViews;
std::vector images;
std::vector framebuffers;
- uint32_t imageIndex;
+ uint32_t imageIndex;
bool resizeFramebuffer;
int flightIndex;
diff --git a/CopiumEngine/src/copium/core/Vulkan.cpp b/CopiumEngine/src/copium/core/Vulkan.cpp
index dff51b3..172bb4f 100644
--- a/CopiumEngine/src/copium/core/Vulkan.cpp
+++ b/CopiumEngine/src/copium/core/Vulkan.cpp
@@ -22,6 +22,10 @@ namespace Copium
{
Timer timer;
timer.Start();
+
+ glfwSetErrorCallback(glfw_error_callback);
+ CP_ASSERT(glfwInit() == GLFW_TRUE, "Failed to initialize the glfw context");
+
instance = std::make_unique("Copium Engine");
window = std::make_unique("Copium Engine", 1440, 810, WindowMode::Windowed);
device = std::make_unique();
@@ -97,4 +101,9 @@ namespace Copium
{
return instance && window && device && swapChain;
}
-}
\ No newline at end of file
+
+ void Vulkan::glfw_error_callback(int error, const char* description)
+ {
+ CP_ABORT("GLFW Error %d: %s\n", error, description);
+ }
+}
diff --git a/CopiumEngine/src/copium/core/Vulkan.h b/CopiumEngine/src/copium/core/Vulkan.h
index a6288a5..de9fde5 100644
--- a/CopiumEngine/src/copium/core/Vulkan.h
+++ b/CopiumEngine/src/copium/core/Vulkan.h
@@ -36,5 +36,8 @@ namespace Copium
static bool Valid();
static AssetHandle GetWhiteTexture2D();
static AssetHandle GetEmptyTexture2D();
+
+ private:
+ static void glfw_error_callback(int error, const char* description);
};
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/core/Window.cpp b/CopiumEngine/src/copium/core/Window.cpp
index 153e611..64b2d30 100644
--- a/CopiumEngine/src/copium/core/Window.cpp
+++ b/CopiumEngine/src/copium/core/Window.cpp
@@ -9,8 +9,8 @@
#include "copium/event/MousePressEvent.h"
#include "copium/event/MouseReleaseEvent.h"
#include "copium/event/MouseScrollEvent.h"
-#include "copium/event/WindowResizeEvent.h"
#include "copium/event/WindowFocusEvent.h"
+#include "copium/event/WindowResizeEvent.h"
#include
@@ -32,7 +32,6 @@ namespace Copium
bool Window::ShouldClose() const
{
return glfwWindowShouldClose(window);
-
}
int Window::GetWidth() const
@@ -72,6 +71,8 @@ namespace Copium
{
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
+ CP_ASSERT(glfwVulkanSupported(), "Vulkan is not supported");
+
switch (mode)
{
case WindowMode::Fullscreen:
@@ -187,4 +188,4 @@ namespace Copium
{
EventDispatcher::QueueEvent(MouseScrollEvent{(int)xoffset, (int)yoffset});
}
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/core/Window.h b/CopiumEngine/src/copium/core/Window.h
index dafdcc9..51cc9da 100644
--- a/CopiumEngine/src/copium/core/Window.h
+++ b/CopiumEngine/src/copium/core/Window.h
@@ -51,4 +51,4 @@ namespace Copium
static void WindowFocusCallback(GLFWwindow* window, int focused);
static void MouseScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
};
-}
\ No newline at end of file
+}
diff --git a/CopiumEngine/src/copium/ecs/ComponentListener.h b/CopiumEngine/src/copium/ecs/ComponentListener.h
index 71087df..c3e5ab7 100644
--- a/CopiumEngine/src/copium/ecs/ComponentListener.h
+++ b/CopiumEngine/src/copium/ecs/ComponentListener.h
@@ -1,9 +1,11 @@
#pragma once
-#include "copium/ecs/ECSManager.h"
+#include "copium/ecs/Config.h"
namespace Copium
{
+ class ECSManager;
+
template
class ComponentListener
{
diff --git a/CopiumEngine/src/copium/ecs/ECSManager.h b/CopiumEngine/src/copium/ecs/ECSManager.h
index e3cc344..28e38a4 100644
--- a/CopiumEngine/src/copium/ecs/ECSManager.h
+++ b/CopiumEngine/src/copium/ecs/ECSManager.h
@@ -11,7 +11,6 @@
#include