project-aster/aster/image.h

38 lines
767 B
C

// =============================================
// Aster: image.h
// Copyright (c) 2020-2024 Anish Bhobe
// =============================================
#pragma once
#include "global.h"
struct Device;
struct Image
{
vk::Image m_Image = nullptr;
vk::ImageView m_View = nullptr;
VmaAllocation m_Allocation = nullptr;
vk::Extent3D m_Extent;
[[nodiscard]] bool IsValid() const;
void Destroy(const Device *device);
};
struct Texture : Image
{
void Init(const Device *device, vk::Extent2D extent, vk::Format imageFormat, bool isMipmapped, cstr name = nullptr);
};
struct DepthImage : Image
{
void Init(const Device *device, vk::Extent2D extent, cstr name = nullptr);
};
inline bool
Image::IsValid() const
{
return m_Image;
}