move some options from swap chain to engine configuration and fix not working VSync

This commit is contained in:
ohyzha
2024-07-22 11:07:33 +03:00
parent bc02c0e937
commit 6ed4136393
5 changed files with 55 additions and 29 deletions

View File

@@ -10,6 +10,7 @@
#include "Image.hpp"
#include "FrameBuffer.hpp"
#include "Base/UI/IWindow.hpp"
#include "Base/EngineConfiguration.hpp"
#include "Base/Logger.hpp"
#include <vulkan/vulkan.hpp>
@@ -46,13 +47,6 @@ namespace OpenVulkano
vk::Rect2D fullscreenScissor;
std::vector<vk::Semaphore> imageAvailableSemaphores;
uint32_t currentSemaphoreId = 0;
bool useVsync = false;
#ifdef __APPLE__
uint32_t preferredImageCount = 3; //TODO add option
#else
uint32_t preferredImageCount = 2; //TODO add option
#endif
vk::Extent2D size{0,0};
public:
@@ -99,13 +93,6 @@ namespace OpenVulkano
}
}
[[nodiscard]] bool UseVsync() const { return useVsync; }
void SetVsync(bool vsync)
{ //TODO change swap chain
this->useVsync = vsync;
}
[[nodiscard]] uint32_t GetImageCount() const
{
return images.size();