Cogs.Core
Public Member Functions | Protected Attributes | List of all members
Cogs::ISwapChain Class Referenceabstract
Inheritance diagram for Cogs::ISwapChain:
Cogs::SwapChainD3D11 Cogs::SwapChainGL20 Cogs::SwapChainWebGPU

Public Member Functions

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, uint32_t presentFlags=PresentFlags::None)=0
 Signal the end of a frame to the graphics device.
 
virtual const RenderTargetHandlegetRenderTarget () const =0
 Returns the render target managed by this swap chain.
 
virtual const DepthStencilHandlegetDepthStencil () 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.
 

Protected Attributes

WindowDatawindowData = nullptr
 

Detailed Description

Definition at line 10 of file ISwapChain.h.

Member Function Documentation

◆ beginFrame()

virtual void Cogs::ISwapChain::beginFrame ( )
pure virtual

Signal the beginning of a new frame to the graphics device.

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

◆ endFrame()

virtual void Cogs::ISwapChain::endFrame ( uint32_t  syncInterval = 0,
uint32_t  presentFlags = PresentFlags::None 
)
pure virtual

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.

Parameters
syncIntervalSynchronization interval.
  • 0 - No synchronization, presentation occurs immediately.
  • 1 - Synchronize presentation after 1 vertical blank.
presentFlagsA combination of PresentFlags controlling the presentation of the rendered frame.
See also
PresentFlags

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

◆ getDepthStencil()

virtual const DepthStencilHandle & Cogs::ISwapChain::getDepthStencil ( ) const
pure virtual

Returns the depth stencil managed by this swap chain.

Implemented in Cogs::SwapChainWebGPU, Cogs::SwapChainD3D11, and Cogs::SwapChainGL20.

◆ getHeight()

virtual int Cogs::ISwapChain::getHeight ( ) const
pure virtual

Returns the pixel height of this swap chain.

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

◆ getRenderTarget()

virtual const RenderTargetHandle & Cogs::ISwapChain::getRenderTarget ( ) const
pure virtual

Returns the render target managed by this swap chain.

Implemented in Cogs::SwapChainWebGPU, Cogs::SwapChainD3D11, and Cogs::SwapChainGL20.

◆ getSamples()

virtual int Cogs::ISwapChain::getSamples ( ) const
pure virtual

Returns the number of samples this swap chain has.

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

◆ getWidth()

virtual int Cogs::ISwapChain::getWidth ( ) const
pure virtual

Returns the pixel width of this swap chain.

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

◆ isFullscreen()

virtual bool Cogs::ISwapChain::isFullscreen ( )
pure virtual

Test whether the current swap chain is fullscreen.

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

◆ setFullscreen()

virtual void Cogs::ISwapChain::setFullscreen ( bool  enabled)
pure virtual

Switch this swap chain to fullscreen or windowed depending on the parameter.

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

◆ setSize()

virtual void Cogs::ISwapChain::setSize ( int  newWidth,
int  newHeight,
bool  forceIt = false 
)
pure virtual

Set the size of the main drawing buffer used by the graphics device in pixels.

Parameters
newWidthWidth of the drawing buffer in pixels.
newHeightHeight of the drawing buffer in pixels.
forceItForce the resize even if the new width and height are identical to the existing values.

Implemented in Cogs::SwapChainD3D11, Cogs::SwapChainGL20, and Cogs::SwapChainWebGPU.

Member Data Documentation

◆ windowData

WindowData* Cogs::ISwapChain::windowData = nullptr
protected

Definition at line 78 of file ISwapChain.h.


The documentation for this class was generated from the following file: