From 888cdf15a90c798ad272679e037ba96d12672abe Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Thu, 22 Sep 2022 18:29:34 -0400 Subject: [PATCH] update .gitmodules --- .gitignore | 2 +- Makefile | 2 +- engine/xe_device.cpp | 6 +++--- engine/xe_engine.cpp | 3 +++ engine/xe_swap_chain.cpp | 12 +++++++++--- engine/xe_swap_chain.hpp | 3 +++ lib/openal | 1 - 7 files changed, 20 insertions(+), 9 deletions(-) delete mode 160000 lib/openal diff --git a/.gitignore b/.gitignore index 0faad08..02685ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .vscode bin .env -*.o \ No newline at end of file +*.o diff --git a/Makefile b/Makefile index f143175..8df8d0a 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CCFLAGS += $(INCFLAGS) LDFLAGS = -lm LDFLAGS += $(INCFLAGS) LDFLAGS += -lglfw -LDFLAGS += lib/glm/glm/libglm_static.a +LDFLAGS += -ldl LDFLAGS += -lopenal LDFLAGS += -lalut LDFLAGS += -lvulkan diff --git a/engine/xe_device.cpp b/engine/xe_device.cpp index fb2bb7b..e58a77e 100755 --- a/engine/xe_device.cpp +++ b/engine/xe_device.cpp @@ -130,7 +130,7 @@ void XeDevice::pickPhysicalDevice() { } vkGetPhysicalDeviceProperties(physicalDevice, &properties); - std::cout << "physical device: " << properties.deviceName << std::endl; + std::cout << "Physical device: " << properties.deviceName << std::endl; } void XeDevice::createLogicalDevice() { @@ -280,14 +280,14 @@ void XeDevice::hasGflwRequiredInstanceExtensions() { std::vector extensions(extensionCount); vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensions.data()); - std::cout << "available extensions:" << std::endl; + std::cout << "Available extensions:" << std::endl; std::unordered_set available; for (const auto &extension : extensions) { std::cout << "\t" << extension.extensionName << std::endl; available.insert(extension.extensionName); } - std::cout << "required extensions:" << std::endl; + std::cout << "Required extensions:" << std::endl; auto requiredExtensions = getRequiredExtensions(); for (const auto &required : requiredExtensions) { std::cout << "\t" << required << std::endl; diff --git a/engine/xe_engine.cpp b/engine/xe_engine.cpp index af2c470..e137d11 100644 --- a/engine/xe_engine.cpp +++ b/engine/xe_engine.cpp @@ -2,6 +2,8 @@ #include "xe_image.hpp" #include +#include +#include #include namespace xe { @@ -12,6 +14,7 @@ XeEngine::XeEngine(int width, int height, std::string name) : xeWindow{width, he xeCamera{} { loadDescriptorPool(); alutInit(0, NULL); + std::cout << "Audio device: " << alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER) << "\n"; }; XeEngine::~XeEngine() { diff --git a/engine/xe_swap_chain.cpp b/engine/xe_swap_chain.cpp index 6e708b9..c7a0345 100755 --- a/engine/xe_swap_chain.cpp +++ b/engine/xe_swap_chain.cpp @@ -11,6 +11,8 @@ namespace xe { +bool XeSwapChain::initialSwapChainCreated = false; + XeSwapChain::XeSwapChain(XeDevice &deviceRef, VkExtent2D extent) : device{deviceRef}, windowExtent{extent} { init(); @@ -30,6 +32,7 @@ void XeSwapChain::init() { createDepthResources(); createFramebuffers(); createSyncObjects(); + initialSwapChainCreated = true; } XeSwapChain::~XeSwapChain() { @@ -382,19 +385,22 @@ VkPresentModeKHR XeSwapChain::chooseSwapPresentMode( const std::vector &availablePresentModes) { for (const auto &availablePresentMode : availablePresentModes) { if (availablePresentMode == VK_PRESENT_MODE_MAILBOX_KHR) { - std::cout << "Present mode: Mailbox" << std::endl; + if(!initialSwapChainCreated) + std::cout << "Present mode: Mailbox" << std::endl; return availablePresentMode; } } for (const auto &availablePresentMode : availablePresentModes) { if (availablePresentMode == VK_PRESENT_MODE_IMMEDIATE_KHR) { - std::cout << "Present mode: Immediate" << std::endl; + if(!initialSwapChainCreated) + std::cout << "Present mode: Immediate" << std::endl; return availablePresentMode; } } - std::cout << "Present mode: V-Sync" << std::endl; + if(!initialSwapChainCreated) + std::cout << "Present mode: V-Sync" << std::endl; return VK_PRESENT_MODE_FIFO_KHR; } diff --git a/engine/xe_swap_chain.hpp b/engine/xe_swap_chain.hpp index 50aa03f..a15a5a0 100755 --- a/engine/xe_swap_chain.hpp +++ b/engine/xe_swap_chain.hpp @@ -83,6 +83,9 @@ class XeSwapChain { std::vector inFlightFences; std::vector imagesInFlight; size_t currentFrame = 0; + + static bool initialSwapChainCreated; + }; } diff --git a/lib/openal b/lib/openal deleted file mode 160000 index c52df6d..0000000 --- a/lib/openal +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c52df6d78ab7131a543326cd2257f267036754e1