#pragma once

/*
	ApplicationFramework
	by John Ryland
	Copyright (c) 2023
*/

////////////////////////////////////////////////////////////////////////////////////
//	Vulkan Texture

//#include "IRenderSystem.h"
#include <vulkan/vulkan.h>
#include "imgui.h"
//#include <memory>

namespace ApplicationFramework {

// A struct to manage data related to one image in vulkan
class VulkanTexture
{
public:
    operator ImTextureID() { return reinterpret_cast<ImTextureID>(DS); }

    VkDescriptorSet DS;         // Descriptor set: this is what you'll pass to ImGui::Image() ?  (ImTextureID)my_texture.DS
    int             Width;
    int             Height;
    int             Channels;

    // Need to keep track of these to properly cleanup
    VkImageView     ImageView            = nullptr;
    VkImage         Image                = nullptr;
    VkDeviceMemory  ImageMemory          = nullptr;
    VkSampler       Sampler              = nullptr;
    VkBuffer        UploadBuffer         = nullptr;
    VkDeviceMemory  UploadBufferMemory   = nullptr;

    VulkanTexture() { memset(this, 0, sizeof(*this)); }
};

} // ApplicationFramework namespace
