Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaWillems committed Apr 17, 2024
1 parent 41e1788 commit dc3ed00
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions base/VulkanDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Encapsulates a physical Vulkan device and its logical representation
*
* Copyright (C) 2016-2023 by Sascha Willems - www.saschawillems.de
* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
Expand Down Expand Up @@ -49,7 +49,7 @@ namespace vks
std::vector<VkExtensionProperties> extensions(extCount);
if (vkEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &extCount, &extensions.front()) == VK_SUCCESS)
{
for (auto ext : extensions)
for (auto& ext : extensions)
{
supportedExtensions.push_back(ext.extensionName);
}
Expand Down
2 changes: 1 addition & 1 deletion base/VulkanUIOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* UI overlay class using ImGui
*
* Copyright (C) 2017 by Sascha Willems - www.saschawillems.de
* Copyright (C) 2017-2024 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
Expand Down
42 changes: 21 additions & 21 deletions base/VulkanUIOverlay.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* UI overlay class using ImGui
*
* Copyright (C) 2017 by Sascha Willems - www.saschawillems.de
* Copyright (C) 2017-2024 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
Expand All @@ -28,43 +28,43 @@
#include "VulkanAndroid.h"
#endif

namespace vks
namespace vks
{
class UIOverlay
class UIOverlay
{
public:
vks::VulkanDevice *device;
VkQueue queue;
vks::VulkanDevice* device{ nullptr };
VkQueue queue{ VK_NULL_HANDLE };

VkSampleCountFlagBits rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
uint32_t subpass = 0;
VkSampleCountFlagBits rasterizationSamples{ VK_SAMPLE_COUNT_1_BIT };
uint32_t subpass{ 0 };

vks::Buffer vertexBuffer;
vks::Buffer indexBuffer;
int32_t vertexCount = 0;
int32_t indexCount = 0;
int32_t vertexCount{ 0 };
int32_t indexCount{ 0 };

std::vector<VkPipelineShaderStageCreateInfo> shaders;

VkDescriptorPool descriptorPool;
VkDescriptorSetLayout descriptorSetLayout;
VkDescriptorSet descriptorSet;
VkPipelineLayout pipelineLayout;
VkPipeline pipeline;
VkDescriptorPool descriptorPool{ VK_NULL_HANDLE };
VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE };
VkDescriptorSet descriptorSet{ VK_NULL_HANDLE };
VkPipelineLayout pipelineLayout{ VK_NULL_HANDLE };
VkPipeline pipeline{ VK_NULL_HANDLE };

VkDeviceMemory fontMemory = VK_NULL_HANDLE;
VkImage fontImage = VK_NULL_HANDLE;
VkImageView fontView = VK_NULL_HANDLE;
VkSampler sampler;
VkDeviceMemory fontMemory{ VK_NULL_HANDLE };
VkImage fontImage{ VK_NULL_HANDLE };
VkImageView fontView{ VK_NULL_HANDLE };
VkSampler sampler{ VK_NULL_HANDLE };

struct PushConstBlock {
glm::vec2 scale;
glm::vec2 translate;
} pushConstBlock;

bool visible = true;
bool updated = false;
float scale = 1.0f;
bool visible{ true };
bool updated{ false };
float scale{ 1.0f };

UIOverlay();
~UIOverlay();
Expand Down

0 comments on commit dc3ed00

Please sign in to comment.