38 lines
743 B
C
38 lines
743 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, 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;
|
|
} |