Use dynamic viewport sizes
This commit is contained in:
@@ -24,8 +24,10 @@ namespace OpenVulkano::Vulkan
|
||||
vk::Format depthBufferFormat = vk::Format::eUndefined, colorFormat = vk::Format::eUndefined;
|
||||
vk::Extent3D size;
|
||||
std::vector<RenderPass*> renderPasses;
|
||||
bool useDepthBuffer;
|
||||
vk::Viewport fullscreenViewport;
|
||||
vk::Rect2D fullscreenScissor;
|
||||
Device* device = nullptr;
|
||||
bool useDepthBuffer;
|
||||
protected:
|
||||
uint32_t currentFrameBufferId = 0;
|
||||
|
||||
@@ -38,15 +40,9 @@ namespace OpenVulkano::Vulkan
|
||||
|
||||
void Init(Device* device, vk::Extent3D size, bool useDepthBuffer = true);
|
||||
|
||||
void SetCurrentFrameId(uint32_t id)
|
||||
{
|
||||
currentFrameBufferId = id;
|
||||
}
|
||||
void SetCurrentFrameId(uint32_t id) { currentFrameBufferId = id; }
|
||||
|
||||
uint32_t GetCurrentFrameId() const
|
||||
{
|
||||
return currentFrameBufferId;
|
||||
}
|
||||
[[nodiscard]] uint32_t GetCurrentFrameId() const { return currentFrameBufferId; }
|
||||
|
||||
public:
|
||||
void RegisterRenderPass(RenderPass* renderPass);
|
||||
@@ -69,44 +65,30 @@ namespace OpenVulkano::Vulkan
|
||||
|
||||
void DestroyFrameBuffer();
|
||||
|
||||
virtual vk::Format FindColorFormat() = 0;
|
||||
[[nodiscard]] virtual vk::Format FindColorFormat() = 0;
|
||||
|
||||
virtual vk::Format FindDepthFormat()
|
||||
[[nodiscard]] virtual vk::Format FindDepthFormat()
|
||||
{
|
||||
return device->GetSupportedDepthFormat();
|
||||
}
|
||||
|
||||
public:
|
||||
virtual vk::Format GetColorFormat()
|
||||
{
|
||||
return colorFormat;
|
||||
}
|
||||
[[nodiscard]] vk::Format GetColorFormat() const { return colorFormat; }
|
||||
|
||||
virtual vk::Format GetDepthFormat()
|
||||
{
|
||||
return depthBufferFormat;
|
||||
}
|
||||
[[nodiscard]] vk::Format GetDepthFormat() const { return depthBufferFormat; }
|
||||
|
||||
virtual std::vector<IImage*> GetImages() = 0;
|
||||
[[nodiscard]] virtual std::vector<IImage*> GetImages() = 0;
|
||||
|
||||
bool UseDepthBuffer() const
|
||||
{
|
||||
return useDepthBuffer;
|
||||
}
|
||||
[[nodiscard]] bool UseDepthBuffer() const { return useDepthBuffer; }
|
||||
|
||||
vk::Extent3D GetSize3D() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
[[nodiscard]] const vk::Extent3D& GetSize3D() const { return size; }
|
||||
|
||||
vk::Extent2D GetSize2D() const
|
||||
{
|
||||
return { size.width, size.height };
|
||||
}
|
||||
[[nodiscard]] vk::Extent2D GetSize2D() const { return { size.width, size.height }; }
|
||||
|
||||
vk::Framebuffer& GetCurrentFrameBuffer()
|
||||
{
|
||||
return frameBuffers[currentFrameBufferId];
|
||||
}
|
||||
[[nodiscard]] vk::Framebuffer& GetCurrentFrameBuffer() { return frameBuffers[currentFrameBufferId]; }
|
||||
|
||||
[[nodiscard]] const vk::Viewport& GetFullscreenViewport() const { return fullscreenViewport; }
|
||||
|
||||
[[nodiscard]] const vk::Rect2D& GetFullscreenScissor() const { return fullscreenScissor; }
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user