|
Cogs.Core
|
Public Member Functions | |
| void | initialize (WGPUDevice device, WGPUSurface surface) |
| void | destroy () |
| void | create () |
| virtual void | beginFrame () override |
| Signal the beginning of a new frame to the graphics device. | |
| virtual void | endFrame (uint32_t syncInterval=0, PresentFlags presentFlags=PresentFlags::None) override |
| Signal the end of a frame to the graphics device. | |
| 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. | |
| virtual void | setFullscreen (bool enabled) override |
| Switch this swap chain to fullscreen or windowed depending on the parameter. | |
| virtual bool | isFullscreen () override |
| Test whether the current swap chain is fullscreen. | |
| virtual int | getWidth () const override |
| Returns the pixel width of this swap chain. | |
| virtual int | getHeight () const override |
| Returns the pixel height of this swap chain. | |
| 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 const DepthStencilHandle & | getDepthStencil () const |
| Returns the depth stencil managed by this swap chain. | |
| WGPUSurfaceTexture | getTextureData () |
| 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 void | setFullscreen (bool enabled)=0 |
| Switch this swap chain to fullscreen or windowed depending on the parameter. | |
| virtual bool | isFullscreen ()=0 |
| Test whether the current swap chain is fullscreen. | |
| virtual void | beginFrame ()=0 |
| Signal the beginning of a new frame to the graphics device. | |
| virtual void | endFrame (uint32_t syncInterval=0, PresentFlags presentFlags=PresentFlags::None)=0 |
| Signal the end of a frame to the graphics device. | |
| 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 int | getWidth () const =0 |
| Returns the pixel width of this swap chain. | |
| virtual int | getHeight () const =0 |
| Returns the pixel height of this swap chain. | |
| virtual int | getSamples () const =0 |
| Returns the number of samples this swap chain has. | |
Public Attributes | |
| WGPUDevice | device = {} |
| WGPUSurface | surface = {} |
| WGPUTexture | colorBufferTexture = {} |
| WGPUTextureView | colorBufferView = {} |
| WGPUTexture | depthBufferTexture = {} |
| WGPUTextureView | depthBufferView = {} |
| WGPUTexture | resolveTexture = {} |
| WGPUTextureView | resolveView = {} |
| int | set_width = 1920 |
| int | set_height = 1080 |
| int | samples = 4 |
| bool | resize = false |
| WGPUTextureFormat | swap_chain_format = WGPUTextureFormat_BGRA8Unorm |
| WGPUTextureFormat | color_format = WGPUTextureFormat_BGRA8UnormSrgb |
| WGPUTextureFormat | depth_format = WGPUTextureFormat_Depth32Float |
Additional Inherited Members | |
Protected Attributes inherited from Cogs::ISwapChain | |
| WindowData * | windowData = nullptr |
Definition at line 8 of file SwapChainWebGPU.h.
| Cogs::SwapChainWebGPU::SwapChainWebGPU | ( | ) |
Definition at line 11 of file SwapChainWebGPU.cpp.
| Cogs::SwapChainWebGPU::~SwapChainWebGPU | ( | ) |
Definition at line 15 of file SwapChainWebGPU.cpp.
|
overridevirtual |
Signal the beginning of a new frame to the graphics device.
Implements Cogs::ISwapChain.
Definition at line 156 of file SwapChainWebGPU.cpp.
Referenced by Cogs::GraphicsDeviceWebGPU::beginFrame().
| void Cogs::SwapChainWebGPU::create | ( | ) |
Definition at line 27 of file SwapChainWebGPU.cpp.
| void Cogs::SwapChainWebGPU::destroy | ( | ) |
Definition at line 137 of file SwapChainWebGPU.cpp.
|
overridevirtual |
Signal the end of a frame to the graphics device.
When the graphics device itself is responsible for managing the device context (e.g in D3D11), and the PresentFlags::NoSwap flag is not set, this will swap the back buffer to make the result of previous drawing visible.
| syncInterval | Synchronization interval.
|
| presentFlags | A combination of PresentFlags controlling the presentation of the rendered frame. |
Implements Cogs::ISwapChain.
Definition at line 178 of file SwapChainWebGPU.cpp.
Referenced by Cogs::GraphicsDeviceWebGPU::endFrame().
|
virtual |
Returns the depth stencil managed by this swap chain.
Implements Cogs::ISwapChain.
Definition at line 209 of file SwapChainWebGPU.cpp.
References Cogs::Handle_t< DepthStencilTag >::InvalidHandle.
|
inlineoverridevirtual |
Returns the pixel height of this swap chain.
Implements Cogs::ISwapChain.
Definition at line 27 of file SwapChainWebGPU.h.
Referenced by Cogs::GraphicsDeviceWebGPU::getSize().
|
virtual |
Returns the render target managed by this swap chain.
Implements Cogs::ISwapChain.
Definition at line 204 of file SwapChainWebGPU.cpp.
References Cogs::Handle_t< RenderTargetTag >::InvalidHandle.
|
inlineoverridevirtual |
Returns the number of samples this swap chain has.
Implements Cogs::ISwapChain.
Definition at line 28 of file SwapChainWebGPU.h.
| WGPUSurfaceTexture Cogs::SwapChainWebGPU::getTextureData | ( | ) |
Definition at line 214 of file SwapChainWebGPU.cpp.
|
inlineoverridevirtual |
Returns the pixel width of this swap chain.
Implements Cogs::ISwapChain.
Definition at line 26 of file SwapChainWebGPU.h.
Referenced by Cogs::GraphicsDeviceWebGPU::getSize().
| void Cogs::SwapChainWebGPU::initialize | ( | WGPUDevice | device, |
| WGPUSurface | surface | ||
| ) |
Definition at line 20 of file SwapChainWebGPU.cpp.
|
overridevirtual |
Test whether the current swap chain is fullscreen.
Implements Cogs::ISwapChain.
Definition at line 199 of file SwapChainWebGPU.cpp.
|
overridevirtual |
Switch this swap chain to fullscreen or windowed depending on the parameter.
Implements Cogs::ISwapChain.
Definition at line 195 of file SwapChainWebGPU.cpp.
|
overridevirtual |
Set the size of the main drawing buffer used by the graphics device in pixels.
| newWidth | Width of the drawing buffer in pixels. |
| newHeight | Height of the drawing buffer in pixels. |
| forceIt | Force the resize even if the new width and height are identical to the existing values. |
Implements Cogs::ISwapChain.
Definition at line 187 of file SwapChainWebGPU.cpp.
Referenced by Cogs::GraphicsDeviceWebGPU::setSize().
| WGPUTextureFormat Cogs::SwapChainWebGPU::color_format = WGPUTextureFormat_BGRA8UnormSrgb |
Definition at line 55 of file SwapChainWebGPU.h.
| WGPUTexture Cogs::SwapChainWebGPU::colorBufferTexture = {} |
Definition at line 38 of file SwapChainWebGPU.h.
| WGPUTextureView Cogs::SwapChainWebGPU::colorBufferView = {} |
Definition at line 39 of file SwapChainWebGPU.h.
| WGPUTextureFormat Cogs::SwapChainWebGPU::depth_format = WGPUTextureFormat_Depth32Float |
Definition at line 56 of file SwapChainWebGPU.h.
| WGPUTexture Cogs::SwapChainWebGPU::depthBufferTexture = {} |
Definition at line 41 of file SwapChainWebGPU.h.
| WGPUTextureView Cogs::SwapChainWebGPU::depthBufferView = {} |
Definition at line 42 of file SwapChainWebGPU.h.
| WGPUDevice Cogs::SwapChainWebGPU::device = {} |
Definition at line 35 of file SwapChainWebGPU.h.
| bool Cogs::SwapChainWebGPU::resize = false |
Definition at line 52 of file SwapChainWebGPU.h.
| WGPUTexture Cogs::SwapChainWebGPU::resolveTexture = {} |
Definition at line 45 of file SwapChainWebGPU.h.
| WGPUTextureView Cogs::SwapChainWebGPU::resolveView = {} |
Definition at line 47 of file SwapChainWebGPU.h.
| int Cogs::SwapChainWebGPU::samples = 4 |
Definition at line 51 of file SwapChainWebGPU.h.
| int Cogs::SwapChainWebGPU::set_height = 1080 |
Definition at line 50 of file SwapChainWebGPU.h.
| int Cogs::SwapChainWebGPU::set_width = 1920 |
Definition at line 49 of file SwapChainWebGPU.h.
| WGPUSurface Cogs::SwapChainWebGPU::surface = {} |
Definition at line 36 of file SwapChainWebGPU.h.
| WGPUTextureFormat Cogs::SwapChainWebGPU::swap_chain_format = WGPUTextureFormat_BGRA8Unorm |
Definition at line 54 of file SwapChainWebGPU.h.