Skip to content

Commit

Permalink
Base #endif UVKE_DEBUG fix and imgui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eUltrabyte committed Mar 20, 2024
1 parent 0713394 commit f767060
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.fleet/
.cache/

vcpkg_installed/

Build/
build/
Bin/
Expand Down
2 changes: 1 addition & 1 deletion Source/uvke/Core/Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace uvke {
debugUtilsMessengerCreateInfo.pUserData = nullptr;

instanceCreateInfo.pNext = (VkDebugUtilsMessengerCreateInfoEXT*)&debugUtilsMessengerCreateInfo;
#elif
#else
instanceCreateInfo.pNext = nullptr;
#endif

Expand Down
2 changes: 1 addition & 1 deletion Source/uvke/Core/Base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace uvke {

#ifdef UVKE_DEBUG
VkDebugUtilsMessengerEXT m_debugUtilsMessenger;
#endif UVKE_DEBUG
#endif

VkPhysicalDevice m_physicalDevice;
VkDevice m_device;
Expand Down
8 changes: 3 additions & 5 deletions Source/uvke/Graphics/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@ namespace uvke {

ImGui_ImplVulkan_Init(&imguiVulkanInitInfo, renderPass);

VkCommandBuffer fontsCommandBuffer = commandBuffer->Begin();
ImGui_ImplVulkan_CreateFontsTexture(fontsCommandBuffer);
commandBuffer->End(fontsCommandBuffer, surface->GetQueue(0));

ImGui_ImplVulkan_DestroyFontUploadObjects();
ImGui_ImplVulkan_CreateFontsTexture();

UVKE_LOG_ADDRESS("Interface Created");
}

Interface::~Interface() {
ImGui_ImplVulkan_DestroyFontsTexture();

vkDestroyDescriptorPool(m_base->GetDevice(), m_descriptorPool, nullptr);
ImGui_ImplVulkan_Shutdown();

Expand Down
14 changes: 7 additions & 7 deletions Source/uvke/Graphics/Sampler.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Sampler.hpp"

namespace uvke {
Sampler::Sampler(Base* base)
Sampler::Sampler(Base* base, VkFilter filter)
: m_base(base) {
{
VkPhysicalDeviceFeatures physicalDeviceFeatures { };
Expand All @@ -14,18 +14,18 @@ namespace uvke {
samplerCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerCreateInfo.pNext = nullptr;
samplerCreateInfo.flags = 0;
samplerCreateInfo.magFilter = VK_FILTER_LINEAR;
samplerCreateInfo.minFilter = VK_FILTER_LINEAR;
samplerCreateInfo.magFilter = filter;
samplerCreateInfo.minFilter = filter;
samplerCreateInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerCreateInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;

if(physicalDeviceFeatures.samplerAnisotropy) {
samplerCreateInfo.anisotropyEnable = VK_TRUE;
samplerCreateInfo.maxAnisotropy = physicalDeviceProperties.limits.maxSamplerAnisotropy;
samplerCreateInfo.anisotropyEnable = VK_TRUE;
samplerCreateInfo.maxAnisotropy = physicalDeviceProperties.limits.maxSamplerAnisotropy;
} else {
samplerCreateInfo.anisotropyEnable = VK_FALSE;
samplerCreateInfo.maxAnisotropy = 1.0f;
samplerCreateInfo.anisotropyEnable = VK_FALSE;
samplerCreateInfo.maxAnisotropy = 1.0f;
}

samplerCreateInfo.borderColor = VK_BORDER_COLOR_INT_OPAQUE_BLACK;
Expand Down
2 changes: 1 addition & 1 deletion Source/uvke/Graphics/Sampler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace uvke {
class UVKE_API Sampler {
public:
Sampler(Base* base = nullptr);
Sampler(Base* base = nullptr, VkFilter filter = VK_FILTER_LINEAR);
virtual ~Sampler();

virtual void SetBase(Base* base);
Expand Down
2 changes: 1 addition & 1 deletion Source/uvke/Graphics/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace uvke {
: m_base(base) {
vec2i imageSize = size;
m_pixels = stbi_load(filename.data(), &imageSize.x, &imageSize.y, &m_channel, STBI_rgb_alpha);

m_image = std::make_unique<Image>(m_base, imageSize);

UVKE_LOG_ADDRESS("Texture Created");
Expand Down

0 comments on commit f767060

Please sign in to comment.