4#include "graphics/GPUObjects.hpp"
5#include "system/Config.hpp"
6#include "resources/Texture.hpp"
30 void resize(uint w, uint h);
65 void setup(uint32_t width, uint32_t height);
Configuration containing parameters for windows and renderers.
Definition: Config.hpp:113
A swapchain handles the creation and presentation of the backbuffer, along with GPU work submission a...
Definition: Swapchain.hpp:16
void clean()
Definition: Swapchain.cpp:374
uint count()
Definition: Swapchain.hpp:38
Texture & depth()
Definition: Swapchain.hpp:50
VkSwapchainKHR _swapchain
Native handle.
Definition: Swapchain.hpp:76
bool nextFrame()
Definition: Swapchain.cpp:312
~Swapchain()
Definition: Swapchain.cpp:364
bool _vsync
Is V-sync enabled.
Definition: Swapchain.hpp:88
bool finishFrame()
Definition: Swapchain.cpp:258
uint _minImageCount
Minimum number of images required by the swapchain.
Definition: Swapchain.hpp:87
std::vector< VkSemaphore > _imagesAvailable
Semaphores signaling when swapchain images are available for a new frame.
Definition: Swapchain.hpp:82
std::vector< VkSemaphore > _framesFinished
Semaphores signaling when a frame has been completed.
Definition: Swapchain.hpp:83
uint minCount()
Definition: Swapchain.hpp:41
std::vector< VkFence > _framesInFlight
Fences ensuring that frames are properly ordered.
Definition: Swapchain.hpp:84
Texture * _backbuffer
The current backbuffer.
Definition: Swapchain.hpp:80
Texture _depth
The shared depth texture.
Definition: Swapchain.hpp:79
uint32_t _imageIndex
Current image index.
Definition: Swapchain.hpp:89
void setup(uint32_t width, uint32_t height)
Definition: Swapchain.cpp:15
bool _frameStarted
Has a frame been previously submitted.
Definition: Swapchain.hpp:90
GPUContext * _context
The GPU internal context.
Definition: Swapchain.hpp:75
Texture & color()
Definition: Swapchain.hpp:47
void resize(uint w, uint h)
Definition: Swapchain.cpp:239
void getFormats(VkFormat &color, VkFormat &depth, VkFormat &stencil)
Definition: Swapchain.cpp:248
std::vector< Texture > _colors
Backbuffers.
Definition: Swapchain.hpp:78
uint _imageCount
Number of images in the swapchain.
Definition: Swapchain.hpp:86
Represents a texture containing one or more images, stored on the CPU and/or GPU.
Definition: Texture.hpp:12
Global GPU context, storing all structures used for resource allocation and tracking,...
Definition: GPUInternal.hpp:72