Cogs.Core
|
Public Member Functions | |
GraphicsDeviceGL20 (RenderingAllocatorInfo *allocator) | |
virtual bool | initialize () override |
Initialises this graphics device. | |
virtual bool | setSettings (const GraphicsDeviceSettings &newSettings) override |
Updates settings for this graphics device. | |
virtual ISwapChain * | createSwapChain (struct WindowData *windowData) override |
Create a new SwapChain and attach it to the provided window. | |
virtual void | deleteSwapChain (ISwapChain *swapChain) override |
Delete the specified SwapChain. | |
virtual std::string | getIdentifier () const override |
Get the graphics device identifier. | |
virtual GraphicsDeviceType | getType () const override |
Get the type of the graphics device. | |
virtual void | setSize (int width, int height) override |
Resizes the output of this graphics device. | |
virtual bool | getSize (int &w, int &h) const override |
Retrieve the current size of this graphics device's default swap chain. | |
virtual void | beginFrame () override |
Prepares the current frame for rendering. | |
virtual void | endFrame (uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None) override |
Finalises frame rendering and presents the new frames to the display (if applicable). | |
virtual void | waitForCommandSync () override |
Forces the calling thread to synchronise with the GPU. | |
virtual void | releaseResources () override |
Release all resources used by this graphics device. | |
virtual SharedGraphicsContext * | createSharedContext () override |
Create a shared graphics context that can be used to activate another thread for rendering. | |
virtual void | activateSharedContext (SharedGraphicsContext *) override |
Activates the given shared context on the calling thread. | |
virtual void | releaseSharedContext (SharedGraphicsContext *) override |
Releases the given shared context. | |
virtual ResourceStatistics | getResourceStatistics () override |
Retrieve statistics about resources currently in use by this graphics device instance. | |
virtual BuffersGL20 * | getBuffers () override |
Get a pointer to the buffer management interface. | |
virtual TexturesGL20 * | getTextures () override |
Get a pointer to the texture management interface. | |
virtual RenderTargetsGL20 * | getRenderTargets () override |
Get a pointer to the render target management interface. | |
virtual EffectsGL20 * | getEffects () override |
Get a pointer to the effect management interface. | |
virtual IPipelineStates * | getPipelineStates () override |
Get a pointer to the pipeline state management interface. | |
virtual ISyncObjects * | getSyncObjects () override |
Get a pointer to the sync object management interface. | |
virtual ContextGL20 * | getImmediateContext () override |
Get a pointer to the immediate context used to issue commands to the graphics device. | |
virtual CapabilitiesGL20 * | getCapabilities () override |
Get a pointer to the capability management interface used to query the graphics device capability flags. | |
virtual SwapChainGL20 * | getDefaultSwapChain () override |
Get a pointer to the default swap chain for this graphics device. | |
GLContext & | getShareContext () |
![]() | |
virtual | ~IGraphicsDevice ()=default |
Destructor. | |
virtual bool | initializeThread () |
Initialize the graphics device for operation on the current thread. | |
virtual SharedGraphicsContext * | createSharedContext () |
Create a shared graphics context that can be used to activate another thread for rendering. | |
virtual void | activateSharedContext (SharedGraphicsContext *) |
Activates the given shared context on the calling thread. | |
virtual void | releaseSharedContext (SharedGraphicsContext *) |
Releases the given shared context. | |
virtual bool | initialize ()=0 |
Initializes the graphics device with the settings previous set through calling setSettings. | |
virtual bool | isInitializationFinished () |
Check if async initialization is finished. | |
virtual ResourceStatistics | getResourceStatistics () |
virtual std::string | getIdentifier () const |
Get the graphics device identifier. | |
virtual GraphicsDeviceType | getType () const |
Get the type of the graphics device. | |
virtual void | setSize (int width, int height)=0 |
Set the size of the main drawing buffer used by the graphics device in pixels. | |
virtual bool | getSize (int &width, int &height) const =0 |
Retrieve the size previously set by setSize. | |
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 void | waitForCommandSync () |
Wait for any GPU commands on the current device to finish before returning. | |
virtual void | releaseResources ()=0 |
Release all resources allocated. | |
virtual ISwapChain * | createSwapChain (struct WindowData *) |
Create a new swap chain for the specified window. | |
virtual void | deleteSwapChain (ISwapChain *) |
Deletes the specified swap chain. | |
virtual IContext * | getImmediateContext ()=0 |
Get a pointer to the immediate context used to issue commands to the graphics device. | |
virtual IBuffers * | getBuffers ()=0 |
Get a pointer to the buffer management interface. | |
virtual ITextures * | getTextures ()=0 |
Get a pointer to the texture management interface. | |
virtual IRenderTargets * | getRenderTargets ()=0 |
Get a pointer to the render target management interface. | |
virtual IEffects * | getEffects ()=0 |
Get a pointer to the effect management interface. | |
virtual IPipelineStates * | getPipelineStates ()=0 |
Get a pointer to the pipeline state management interface. | |
virtual ICapabilities * | getCapabilities ()=0 |
Get a pointer to the capability management interface used to query the graphics device capability flags. | |
virtual ISwapChain * | getDefaultSwapChain ()=0 |
Get a pointer to the default swap chain for this graphics device. | |
virtual ISyncObjects * | getSyncObjects ()=0 |
Get a pointer to the sync object management interface. | |
virtual void * | getNativeDevice () |
virtual bool | setSettings (const GraphicsDeviceSettings &newSettings) |
Updates the settings associated with this device. | |
const GraphicsDeviceSettings & | getSettings () const |
Additional Inherited Members | |
![]() | |
static void | fillGraphicsSettings (struct WindowData *windowData, int requestedSampleCount) |
Set platform specific graphics settings used for window creation e.g.: XVisualInfo on Linux. | |
![]() | |
GraphicsDeviceSettings | settings |
std::vector< ISwapChain * > | swapChains |
Definition at line 20 of file GraphicsDeviceGL20.h.
Cogs::GraphicsDeviceGL20::GraphicsDeviceGL20 | ( | RenderingAllocatorInfo * | allocator | ) |
Definition at line 19 of file GraphicsDeviceGL20.cpp.
Cogs::GraphicsDeviceGL20::~GraphicsDeviceGL20 | ( | ) |
Definition at line 22 of file GraphicsDeviceGL20.cpp.
|
overridevirtual |
Activates the given shared context on the calling thread.
context | Pointer to a shared graphics context. |
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 249 of file GraphicsDeviceGL20.cpp.
|
overridevirtual |
Prepares the current frame for rendering.
*============================================================================================
Implements Cogs::IGraphicsDevice.
Definition at line 149 of file GraphicsDeviceGL20.cpp.
|
overridevirtual |
Create a shared graphics context that can be used to activate another thread for rendering.
When using OpenGL on the windows platform, rendering contexts have to be made separate for each thread. These contexts must also be made current on their respective threads to enable calling GL functions there.
This function must be called from the same thread that the device was created on.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 237 of file GraphicsDeviceGL20.cpp.
References Cogs::EnableDiagnostics.
|
overridevirtual |
Create a new SwapChain and attach it to the provided window.
*============================================================================================
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 104 of file GraphicsDeviceGL20.cpp.
References Cogs::EnableDiagnostics, and Cogs::SwapChainGL20::initialize().
|
overridevirtual |
Delete the specified SwapChain.
*============================================================================================
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 119 of file GraphicsDeviceGL20.cpp.
|
overridevirtual |
Finalises frame rendering and presents the new frames to the display (if applicable).
*============================================================================================
Implements Cogs::IGraphicsDevice.
Definition at line 166 of file GraphicsDeviceGL20.cpp.
|
inlineoverridevirtual |
Get a pointer to the buffer management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 49 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get a pointer to the capability management interface used to query the graphics device capability flags.
Implements Cogs::IGraphicsDevice.
Definition at line 56 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get a pointer to the default swap chain for this graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 57 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get a pointer to the effect management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 52 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get the graphics device identifier.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 32 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get a pointer to the immediate context used to issue commands to the graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 55 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get a pointer to the pipeline state management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 53 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get a pointer to the render target management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 51 of file GraphicsDeviceGL20.h.
|
overridevirtual |
Retrieve statistics about resources currently in use by this graphics device instance.
*============================================================================================
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 211 of file GraphicsDeviceGL20.cpp.
|
inline |
Definition at line 59 of file GraphicsDeviceGL20.h.
|
overridevirtual |
Retrieve the current size of this graphics device's default swap chain.
*============================================================================================
Implements Cogs::IGraphicsDevice.
Definition at line 140 of file GraphicsDeviceGL20.cpp.
|
inlineoverridevirtual |
Get a pointer to the sync object management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 54 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get a pointer to the texture management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 50 of file GraphicsDeviceGL20.h.
|
inlineoverridevirtual |
Get the type of the graphics device.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 33 of file GraphicsDeviceGL20.h.
References Cogs::OpenGL20.
|
overridevirtual |
Initialises this graphics device.
This function can (and probably should be) called after setSettings has been called. *============================================================================================
Implements Cogs::IGraphicsDevice.
Definition at line 31 of file GraphicsDeviceGL20.cpp.
References Cogs::EnableDiagnostics, and Cogs::UseOpenGLClipControl.
|
overridevirtual |
Release all resources used by this graphics device.
(Typically called during destruction.) *============================================================================================
Implements Cogs::IGraphicsDevice.
Definition at line 193 of file GraphicsDeviceGL20.cpp.
References Cogs::Handle_t< SamplerTag >::NoHandle.
|
overridevirtual |
Releases the given shared context.
context | Pointer to a shared graphics context. |
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 256 of file GraphicsDeviceGL20.cpp.
|
overridevirtual |
Updates settings for this graphics device.
This should typically be called before calling initialize. *============================================================================================
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 91 of file GraphicsDeviceGL20.cpp.
References Cogs::IGraphicsDevice::setSettings().
|
overridevirtual |
Resizes the output of this graphics device.
(Actually resizes the output of the default swap chain.) *============================================================================================
Implements Cogs::IGraphicsDevice.
Definition at line 133 of file GraphicsDeviceGL20.cpp.
|
overridevirtual |
Forces the calling thread to synchronise with the GPU.
*============================================================================================
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 177 of file GraphicsDeviceGL20.cpp.
References Cogs::Series::FireGL.
|
private |
Definition at line 62 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 67 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 66 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 69 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 64 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 80 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 76 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 71 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 73 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 74 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 72 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 65 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 68 of file GraphicsDeviceGL20.h.
|
private |
Definition at line 63 of file GraphicsDeviceGL20.h.