moving files to better dirs

This commit is contained in:
2026-09-21 01:10:13 -07:00
parent 8fbabda095
commit 650b4d813f
14 changed files with 16 additions and 16 deletions
+51
View File
@@ -0,0 +1,51 @@
#pragma once
#include <memory>
#include <optional>
#include <sophia/types.hpp>
#include <vulkan/vulkan.hpp>
#include "device.hpp"
#include "image.hpp"
namespace sophia {
/**
* A place rendering can go. Currently always backed by an offscreen color
* image.
*
* Owned by the ResourceRegistry and addressed through a RenderTargetHandle.
*/
class RenderTarget {
public:
RenderTarget(Device& device, vk::Format format, u32 width, u32 height);
~RenderTarget();
RenderTarget(const RenderTarget&) = delete;
RenderTarget& operator=(const RenderTarget&) = delete;
Image& getImage() const { return *this->image; }
vk::Extent2D getExtent() const;
void requestResize(u32 width, u32 height);
/**
* Applies a pending resize. Waits for the GPU, so it must run before any of
* the frame's work (or any UI reference to the image) is recorded.
*/
void applyPendingResize();
private:
void create(u32 width, u32 height);
void destroy();
Device& device;
vk::Format format;
std::unique_ptr<Image> image;
std::optional<vk::Extent2D> pendingExtent;
};
} // namespace sophia