18#ifndef INCLUDED_RENDERER_BACKEND_GL_SWAPCHAIN
19#define INCLUDED_RENDERER_BACKEND_GL_SWAPCHAIN
33#include <unordered_map>
55 bool IsValid()
const override {
return true; }
70 static std::unique_ptr<CSwapChain>
Create(
72 int surfaceDrawableWidth,
int surfaceDrawableHeight,
struct SDL_Window SDL_Window
Definition: VideoMode.h:31
Definition: SwapChain.h:49
SDL_Window * m_Window
Definition: SwapChain.h:78
bool AcquireNextBackbuffer() override
Acquires a backbuffer for rendering a frame.
Definition: SwapChain.cpp:72
IDevice * GetDevice() override
Definition: SwapChain.cpp:67
~CSwapChain() override
Definition: SwapChain.cpp:63
void Present() override
Presents the backbuffer to the swapchain queue to be flipped on a screen.
Definition: SwapChain.cpp:109
CDevice * m_Device
Definition: SwapChain.h:77
std::unordered_map< BackbufferKey, std::unique_ptr< CFramebuffer >, BackbufferKeyHash > m_Backbuffers
Definition: SwapChain.h:93
bool m_BackbufferAcquired
Definition: SwapChain.h:94
static std::unique_ptr< CSwapChain > Create(CDevice *device, SDL_Window *window, int surfaceDrawableWidth, int surfaceDrawableHeight, const bool vsync)
Definition: SwapChain.cpp:47
int m_SurfaceDrawableHeight
Definition: SwapChain.h:80
int m_SurfaceDrawableWidth
Definition: SwapChain.h:79
std::tuple< AttachmentLoadOp, AttachmentStoreOp, AttachmentLoadOp, AttachmentStoreOp > BackbufferKey
Definition: SwapChain.h:84
IFramebuffer * GetCurrentBackbuffer(const AttachmentLoadOp colorAttachmentLoadOp, const AttachmentStoreOp colorAttachmentStoreOp, const AttachmentLoadOp depthStencilAttachmentLoadOp, const AttachmentStoreOp depthStencilAttachmentStoreOp) override
Returns a framebuffer for the current backbuffer with the required attachment operations.
Definition: SwapChain.cpp:89
bool IsValid() const override
Definition: SwapChain.h:55
IFramebuffer stores attachments which should be used by backend as rendering destinations.
Definition: IFramebuffer.h:87
Definition: ISwapChain.h:33
AttachmentStoreOp
Store operation is set for each attachment, what should be done with its content on EndFramebufferPas...
Definition: IFramebuffer.h:54
Backend
Definition: Backend.h:28
AttachmentLoadOp
Load operation is set for each attachment, what should be done with its content on BeginFramebufferPa...
Definition: IFramebuffer.h:39
Definition: Canvas2D.h:30
Definition: SwapChain.h:86
size_t operator()(const BackbufferKey &key) const
Definition: SwapChain.cpp:79
pthread_key_t key
Definition: wpthread.cpp:141