Cogs.Core
ISwapChain.h
1#pragma once
2
3#include "Common.h"
4#include "TextureData.h"
5
6namespace Cogs {
7 class IGraphicsDevice;
8 struct WindowData;
9
10 class ISwapChain {
11 public:
12
13 virtual ~ISwapChain() = default;
14
22 virtual void setSize(int newWidth, int newHeight, bool forceIt = false) = 0;
23
27 virtual void setFullscreen(bool enabled) = 0;
28
32 virtual bool isFullscreen() = 0;
33
37 virtual void beginFrame() = 0;
38
50 virtual void endFrame(uint32_t syncInterval = 0, uint32_t presentFlags = PresentFlags::None) = 0;
51
55 virtual const RenderTargetHandle& getRenderTarget() const = 0;
56
60 virtual const DepthStencilHandle& getDepthStencil() const = 0;
61
65 virtual int getWidth() const = 0;
66
70 virtual int getHeight() const = 0;
71
75 virtual int getSamples() const = 0;
76
77 protected:
78 WindowData* windowData = nullptr;
79 };
80}
virtual void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None)=0
Signal the end of a frame to the graphics device.
virtual int getWidth() const =0
Returns the pixel width of this swap chain.
virtual void beginFrame()=0
Signal the beginning of a new frame to the graphics device.
virtual void setSize(int newWidth, int newHeight, bool forceIt=false)=0
Set the size of the main drawing buffer used by the graphics device in pixels.
virtual int getHeight() const =0
Returns the pixel height of this swap chain.
virtual void setFullscreen(bool enabled)=0
Switch this swap chain to fullscreen or windowed depending on the parameter.
virtual const RenderTargetHandle & getRenderTarget() const =0
Returns the render target managed by this swap chain.
virtual const DepthStencilHandle & getDepthStencil() const =0
Returns the depth stencil managed by this swap chain.
virtual bool isFullscreen()=0
Test whether the current swap chain is fullscreen.
virtual int getSamples() const =0
Returns the number of samples this swap chain has.
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
@ None
No flags.
Definition: Common.h:177