Cogs.Core
|
Public Member Functions | |
SwapChainGL20 (GraphicsDeviceGL20 *device, bool isPrimary) | |
bool | initialize (WindowData *windowData, bool debugLogging) |
Initialises this swap chain and attaches it to the window provided. | |
void | destroy () |
virtual void | beginFrame () override |
Prepares this swap chain for rendering. | |
virtual void | endFrame (uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None) override |
Finalises rendering and swaps the front and back buffers of this swap chain instance. | |
void | ReleaseFence () |
void | ReleaseWait () |
virtual void | setSize (int newWidth, int newHeight, bool forceIt=false) override |
Changes the size of this swap chain's viewport. | |
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 override |
Returns the render target managed by this swap chain. | |
virtual const DepthStencilHandle & | getDepthStencil () const override |
Returns the depth stencil managed by this swap chain. | |
bool | recreateOffscreenBuffers () |
Recreates the textures and render targets used for offscreen rendering. | |
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 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. | |
Private Attributes | |
GLContext | glContext |
GLsync | release = 0 |
GraphicsDeviceGL20 * | graphicsDevice = nullptr |
int | width = 1280 |
int | height = 720 |
TextureHandle | textureHandle |
RenderTargetHandle | renderTarget |
DepthStencilHandle | depthStencil |
uint32_t | framebuffer = 0 |
const bool | isPrimary = false |
bool | fullscreen = false |
bool | needsResize = true |
Additional Inherited Members | |
![]() | |
WindowData * | windowData = nullptr |
Definition at line 20 of file SwapChainGL20.h.
Cogs::SwapChainGL20::SwapChainGL20 | ( | GraphicsDeviceGL20 * | device, |
bool | isPrimary | ||
) |
Definition at line 14 of file SwapChainGL20.cpp.
Cogs::SwapChainGL20::~SwapChainGL20 | ( | ) |
Definition at line 19 of file SwapChainGL20.cpp.
|
overridevirtual |
Prepares this swap chain for rendering.
*============================================================================================
Implements Cogs::ISwapChain.
Definition at line 77 of file SwapChainGL20.cpp.
void Cogs::SwapChainGL20::destroy | ( | ) |
Definition at line 68 of file SwapChainGL20.cpp.
|
overridevirtual |
Finalises rendering and swaps the front and back buffers of this swap chain instance.
*============================================================================================
Implements Cogs::ISwapChain.
Definition at line 95 of file SwapChainGL20.cpp.
|
inlineoverridevirtual |
Returns the depth stencil managed by this swap chain.
Implements Cogs::ISwapChain.
Definition at line 44 of file SwapChainGL20.h.
|
inlineoverridevirtual |
Returns the pixel height of this swap chain.
Implements Cogs::ISwapChain.
Definition at line 40 of file SwapChainGL20.h.
|
inlineoverridevirtual |
Returns the render target managed by this swap chain.
Implements Cogs::ISwapChain.
Definition at line 43 of file SwapChainGL20.h.
|
overridevirtual |
Returns the number of samples this swap chain has.
Implements Cogs::ISwapChain.
Definition at line 157 of file SwapChainGL20.cpp.
|
inlineoverridevirtual |
Returns the pixel width of this swap chain.
Implements Cogs::ISwapChain.
Definition at line 39 of file SwapChainGL20.h.
bool Cogs::SwapChainGL20::initialize | ( | WindowData * | winData, |
bool | debugLogging | ||
) |
Initialises this swap chain and attaches it to the window provided.
*============================================================================================
Definition at line 25 of file SwapChainGL20.cpp.
References Cogs::GraphicsDeviceSettings::numSamples.
Referenced by Cogs::GraphicsDeviceGL20::createSwapChain().
|
inlineoverridevirtual |
Test whether the current swap chain is fullscreen.
Implements Cogs::ISwapChain.
Definition at line 37 of file SwapChainGL20.h.
bool Cogs::SwapChainGL20::recreateOffscreenBuffers | ( | ) |
Recreates the textures and render targets used for offscreen rendering.
This function will be called in response to a resize request (through a call to setSize), and once after initialisation of this swap chain. Offscreen rendering will be used for all secondary swap chains, and the primary swap chain in the case of headless rendering. *============================================================================================
Definition at line 167 of file SwapChainGL20.cpp.
References Cogs::GraphicsDeviceSettings::colorFormat, Cogs::RenderTargetsGL20::createDepthStencilTarget(), Cogs::RenderTargetsGL20::createRenderTarget(), Cogs::TexturesGL20::loadTexture(), Cogs::RenderTargetViewDescription::numLayers, Cogs::GraphicsDeviceSettings::numSamples, Cogs::RenderTargetsGL20::releaseDepthStencilTarget(), Cogs::RenderTargetsGL20::releaseRenderTarget(), Cogs::TexturesGL20::releaseTexture(), Cogs::TextureFlags::RenderTarget, and Cogs::RenderTargetViewDescription::texture.
void Cogs::SwapChainGL20::ReleaseFence | ( | ) |
Definition at line 127 of file SwapChainGL20.cpp.
void Cogs::SwapChainGL20::ReleaseWait | ( | ) |
Definition at line 133 of file SwapChainGL20.cpp.
|
overridevirtual |
Switch this swap chain to fullscreen or windowed depending on the parameter.
Implements Cogs::ISwapChain.
Definition at line 154 of file SwapChainGL20.cpp.
|
overridevirtual |
Changes the size of this swap chain's viewport.
(Actually requests a size change before rendering commences.) *============================================================================================
Implements Cogs::ISwapChain.
Definition at line 146 of file SwapChainGL20.cpp.
|
private |
Definition at line 57 of file SwapChainGL20.h.
|
private |
Definition at line 58 of file SwapChainGL20.h.
|
private |
Definition at line 61 of file SwapChainGL20.h.
|
private |
Definition at line 49 of file SwapChainGL20.h.
|
private |
Definition at line 52 of file SwapChainGL20.h.
|
private |
Definition at line 54 of file SwapChainGL20.h.
|
private |
Definition at line 60 of file SwapChainGL20.h.
|
private |
Definition at line 62 of file SwapChainGL20.h.
|
private |
Definition at line 50 of file SwapChainGL20.h.
|
private |
Definition at line 56 of file SwapChainGL20.h.
|
private |
Definition at line 55 of file SwapChainGL20.h.
|
private |
Definition at line 53 of file SwapChainGL20.h.