3#include "../IGraphicsDevice.h"
4#include "../BaseGL/GLContext.h"
5#include "CapabilitiesGL20.h"
6#include "BuffersGL20.h"
7#include "TexturesGL20.h"
8#include "EffectsGL20.h"
9#include "RenderTargetsGL20.h"
10#include "../BaseGL/SyncObjects.h"
12#include "ContextGL20.h"
13#include "SwapChainGL20.h"
32 virtual std::string
getIdentifier()
const override {
return "OpenGL20"; }
35 virtual void setSize(
int width,
int height)
override;
36 virtual bool getSize(
int& w,
int& h)
const override;
59 GLContext& getShareContext() {
return glShareContext; }
63 TexturesGL20 textures;
65 RenderTargetsGL20 renderTargets;
67 CapabilitiesGL20 capabilities;
68 GLSyncObjects syncObjects;
69 SwapChainGL20 defaultSwapChain;
71 RenderTargetHandle offscreenRenderTargetHandle;
72 TextureHandle offscreenTextureHandle;
73 RenderTargetHandle offscreenResolveRenderTargetHandle;
74 TextureHandle offscreenResolveTextureHandle;
76 bool initialized =
false;
80 GLContext glShareContext;
virtual BuffersGL20 * getBuffers() override
Get a pointer to the buffer management interface.
virtual bool initialize() override
Initialises this graphics device.
virtual void activateSharedContext(SharedGraphicsContext *) override
Activates the given shared context on the calling thread.
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 GraphicsDeviceType getType() const override
Get the type of the graphics device.
virtual std::string getIdentifier() const override
Get the graphics device identifier.
virtual SharedGraphicsContext * createSharedContext() override
Create a shared graphics context that can be used to activate another thread for rendering.
virtual void releaseResources() override
Release all resources used by this graphics device.
virtual ISyncObjects * getSyncObjects() override
Get a pointer to the sync object management interface.
virtual void beginFrame() override
Prepares the current frame for rendering.
virtual bool getSize(int &w, int &h) const override
Retrieve the current size of this graphics device's default swap chain.
virtual RenderTargetsGL20 * getRenderTargets() override
Get a pointer to the render target management interface.
virtual bool setSettings(const GraphicsDeviceSettings &newSettings) override
Updates settings for this graphics device.
virtual SwapChainGL20 * getDefaultSwapChain() override
Get a pointer to the default swap chain for this graphics device.
virtual void waitForCommandSync() override
Forces the calling thread to synchronise with the GPU.
virtual TexturesGL20 * getTextures() override
Get a pointer to the texture management interface.
virtual ContextGL20 * getImmediateContext() override
Get a pointer to the immediate context used to issue commands to the graphics device.
virtual void deleteSwapChain(ISwapChain *swapChain) override
Delete the specified SwapChain.
virtual CapabilitiesGL20 * getCapabilities() override
Get a pointer to the capability management interface used to query the graphics device capability fla...
virtual void releaseSharedContext(SharedGraphicsContext *) override
Releases the given shared context.
virtual ISwapChain * createSwapChain(struct WindowData *windowData) override
Create a new SwapChain and attach it to the provided window.
virtual void setSize(int width, int height) override
Resizes the output of this graphics device.
virtual IPipelineStates * getPipelineStates() override
Get a pointer to the pipeline state management interface.
virtual EffectsGL20 * getEffects() override
Get a pointer to the effect management interface.
virtual ResourceStatistics getResourceStatistics() override
Retrieve statistics about resources currently in use by this graphics device instance.
Represents a graphics device used to manage graphics resources and issue drawing commands.
Contains all Cogs related functionality.
GraphicsDeviceType
Contains types of graphics devices that may be supported.
@ OpenGL20
Graphics device using OpenGL, supporting at least OpenGL 2.0.
Settings for graphics device initialization.
Provides sync object management.