3#include "CommonWebGPU.h"
5#include "../ISwapChain.h"
13 void initialize(WGPUDevice device, WGPUSurface surface);
21 virtual void setSize(
int newWidth,
int newHeight,
bool forceIt =
false)
override;
26 virtual int getWidth()
const override {
return set_width; }
27 virtual int getHeight()
const override {
return set_height; }
28 virtual int getSamples()
const override {
return samples; }
33 WGPUDevice device = {};
34 WGPUSurface surface = {};
35 WGPUSwapChain swapChain = {};
37 WGPUTexture colorBufferTexture = {};
38 WGPUTextureView colorBufferView = {};
40 WGPUTexture depthBufferTexture = {};
41 WGPUTextureView depthBufferView = {};
44 WGPUTexture resolveTexture = {};
46 WGPUTextureView resolveView = {};
49 int set_height = 1080;
54 WGPUTextureFormat swap_chain_format = WGPUTextureFormat_BGRA8Unorm;
55 WGPUTextureFormat color_format = WGPUTextureFormat_BGRA8Unorm;
56 WGPUTextureFormat depth_format = WGPUTextureFormat_Depth32Float;
58 WGPUTextureFormat swap_chain_format = WGPUTextureFormat_BGRA8Unorm;
59 WGPUTextureFormat color_format = WGPUTextureFormat_BGRA8UnormSrgb;
60 WGPUTextureFormat depth_format = WGPUTextureFormat_Depth32Float;
virtual bool isFullscreen() override
Test whether the current swap chain is fullscreen.
virtual const DepthStencilHandle & getDepthStencil() const
Returns the depth stencil managed by this swap chain.
virtual void beginFrame() override
Signal the beginning of a new frame to the graphics device.
virtual int getWidth() const override
Returns the pixel width of this swap chain.
virtual void setFullscreen(bool enabled) override
Switch this swap chain to fullscreen or windowed depending on the parameter.
virtual int getHeight() const override
Returns the pixel height of this swap chain.
virtual void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None) override
Signal the end of a frame to the graphics device.
virtual int getSamples() const override
Returns the number of samples this swap chain has.
virtual const RenderTargetHandle & getRenderTarget() const
Returns the render target managed by this swap chain.
virtual void setSize(int newWidth, int newHeight, bool forceIt=false) override
Set the size of the main drawing buffer used by the graphics device in pixels.
Contains all Cogs related functionality.