update .gitmodules
This commit is contained in:
parent
cbe1374b03
commit
888cdf15a9
7 changed files with 20 additions and 9 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
.vscode
|
.vscode
|
||||||
bin
|
bin
|
||||||
.env
|
.env
|
||||||
*.o
|
*.o
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -13,7 +13,7 @@ CCFLAGS += $(INCFLAGS)
|
||||||
LDFLAGS = -lm
|
LDFLAGS = -lm
|
||||||
LDFLAGS += $(INCFLAGS)
|
LDFLAGS += $(INCFLAGS)
|
||||||
LDFLAGS += -lglfw
|
LDFLAGS += -lglfw
|
||||||
LDFLAGS += lib/glm/glm/libglm_static.a
|
LDFLAGS += -ldl
|
||||||
LDFLAGS += -lopenal
|
LDFLAGS += -lopenal
|
||||||
LDFLAGS += -lalut
|
LDFLAGS += -lalut
|
||||||
LDFLAGS += -lvulkan
|
LDFLAGS += -lvulkan
|
||||||
|
|
|
@ -130,7 +130,7 @@ void XeDevice::pickPhysicalDevice() {
|
||||||
}
|
}
|
||||||
|
|
||||||
vkGetPhysicalDeviceProperties(physicalDevice, &properties);
|
vkGetPhysicalDeviceProperties(physicalDevice, &properties);
|
||||||
std::cout << "physical device: " << properties.deviceName << std::endl;
|
std::cout << "Physical device: " << properties.deviceName << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XeDevice::createLogicalDevice() {
|
void XeDevice::createLogicalDevice() {
|
||||||
|
@ -280,14 +280,14 @@ void XeDevice::hasGflwRequiredInstanceExtensions() {
|
||||||
std::vector<VkExtensionProperties> extensions(extensionCount);
|
std::vector<VkExtensionProperties> extensions(extensionCount);
|
||||||
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensions.data());
|
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensions.data());
|
||||||
|
|
||||||
std::cout << "available extensions:" << std::endl;
|
std::cout << "Available extensions:" << std::endl;
|
||||||
std::unordered_set<std::string> available;
|
std::unordered_set<std::string> available;
|
||||||
for (const auto &extension : extensions) {
|
for (const auto &extension : extensions) {
|
||||||
std::cout << "\t" << extension.extensionName << std::endl;
|
std::cout << "\t" << extension.extensionName << std::endl;
|
||||||
available.insert(extension.extensionName);
|
available.insert(extension.extensionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "required extensions:" << std::endl;
|
std::cout << "Required extensions:" << std::endl;
|
||||||
auto requiredExtensions = getRequiredExtensions();
|
auto requiredExtensions = getRequiredExtensions();
|
||||||
for (const auto &required : requiredExtensions) {
|
for (const auto &required : requiredExtensions) {
|
||||||
std::cout << "\t" << required << std::endl;
|
std::cout << "\t" << required << std::endl;
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#include "xe_image.hpp"
|
#include "xe_image.hpp"
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <iostream>
|
||||||
|
#include <AL/alc.h>
|
||||||
#include <AL/alut.h>
|
#include <AL/alut.h>
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
@ -12,6 +14,7 @@ XeEngine::XeEngine(int width, int height, std::string name) : xeWindow{width, he
|
||||||
xeCamera{} {
|
xeCamera{} {
|
||||||
loadDescriptorPool();
|
loadDescriptorPool();
|
||||||
alutInit(0, NULL);
|
alutInit(0, NULL);
|
||||||
|
std::cout << "Audio device: " << alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER) << "\n";
|
||||||
};
|
};
|
||||||
|
|
||||||
XeEngine::~XeEngine() {
|
XeEngine::~XeEngine() {
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
|
||||||
|
bool XeSwapChain::initialSwapChainCreated = false;
|
||||||
|
|
||||||
XeSwapChain::XeSwapChain(XeDevice &deviceRef, VkExtent2D extent)
|
XeSwapChain::XeSwapChain(XeDevice &deviceRef, VkExtent2D extent)
|
||||||
: device{deviceRef}, windowExtent{extent} {
|
: device{deviceRef}, windowExtent{extent} {
|
||||||
init();
|
init();
|
||||||
|
@ -30,6 +32,7 @@ void XeSwapChain::init() {
|
||||||
createDepthResources();
|
createDepthResources();
|
||||||
createFramebuffers();
|
createFramebuffers();
|
||||||
createSyncObjects();
|
createSyncObjects();
|
||||||
|
initialSwapChainCreated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
XeSwapChain::~XeSwapChain() {
|
XeSwapChain::~XeSwapChain() {
|
||||||
|
@ -382,19 +385,22 @@ VkPresentModeKHR XeSwapChain::chooseSwapPresentMode(
|
||||||
const std::vector<VkPresentModeKHR> &availablePresentModes) {
|
const std::vector<VkPresentModeKHR> &availablePresentModes) {
|
||||||
for (const auto &availablePresentMode : availablePresentModes) {
|
for (const auto &availablePresentMode : availablePresentModes) {
|
||||||
if (availablePresentMode == VK_PRESENT_MODE_MAILBOX_KHR) {
|
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;
|
return availablePresentMode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &availablePresentMode : availablePresentModes) {
|
for (const auto &availablePresentMode : availablePresentModes) {
|
||||||
if (availablePresentMode == VK_PRESENT_MODE_IMMEDIATE_KHR) {
|
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;
|
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;
|
return VK_PRESENT_MODE_FIFO_KHR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,9 @@ class XeSwapChain {
|
||||||
std::vector<VkFence> inFlightFences;
|
std::vector<VkFence> inFlightFences;
|
||||||
std::vector<VkFence> imagesInFlight;
|
std::vector<VkFence> imagesInFlight;
|
||||||
size_t currentFrame = 0;
|
size_t currentFrame = 0;
|
||||||
|
|
||||||
|
static bool initialSwapChainCreated;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit c52df6d78ab7131a543326cd2257f267036754e1
|
|
Loading…
Reference in a new issue