15 struct IPipelineStates;
16 struct IRenderTargets;
19 struct ResourceStatistics;
242 virtual void setSize(
int width,
int height) = 0;
247 virtual bool getSize(
int& width,
int& height)
const = 0;
353 virtual void* getNativeDevice() {
return nullptr; }
373 GraphicsDeviceSettings settings;
374 std::vector<ISwapChain*> swapChains;
Represents a graphics device used to manage graphics resources and issue drawing commands.
virtual IEffects * getEffects()=0
Get a pointer to the effect management interface.
virtual ISyncObjects * getSyncObjects()=0
Get a pointer to the sync object management interface.
virtual void releaseSharedContext(SharedGraphicsContext *)
Releases the given shared context.
virtual ITextures * getTextures()=0
Get a pointer to the texture management interface.
virtual void waitForCommandSync()
Wait for any GPU commands on the current device to finish before returning.
virtual void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None)=0
Signal the end of a frame to the graphics device.
virtual ~IGraphicsDevice()=default
Destructor.
virtual void deleteSwapChain(ISwapChain *)
Deletes the specified swap chain.
virtual bool setSettings(const GraphicsDeviceSettings &newSettings)
Updates the settings associated with this device.
virtual ISwapChain * createSwapChain(struct WindowData *)
Create a new swap chain for the specified window.
virtual ICapabilities * getCapabilities()=0
Get a pointer to the capability management interface used to query the graphics device capability fla...
virtual IContext * getImmediateContext()=0
Get a pointer to the immediate context used to issue commands to the graphics device.
virtual void releaseResources()=0
Release all resources allocated.
virtual void beginFrame()=0
Signal the beginning of a new frame to the graphics device.
virtual void activateSharedContext(SharedGraphicsContext *)
Activates the given shared context on the calling thread.
virtual bool isInitializationFinished()
Check if async initialization is finished.
static void fillGraphicsSettings(struct WindowData *windowData, int requestedSampleCount)
Set platform specific graphics settings used for window creation e.g.: XVisualInfo on Linux.
virtual IBuffers * getBuffers()=0
Get a pointer to the buffer management interface.
virtual std::string getIdentifier() const
Get the graphics device identifier.
virtual bool initialize()=0
Initializes the graphics device with the settings previous set through calling setSettings.
virtual GraphicsDeviceType getType() const
Get the type of the graphics device.
virtual bool getSize(int &width, int &height) const =0
Retrieve the size previously set by setSize.
virtual void setSize(int width, int height)=0
Set the size of the main drawing buffer used by the graphics device in pixels.
virtual SharedGraphicsContext * createSharedContext()
Create a shared graphics context that can be used to activate another thread for rendering.
virtual IRenderTargets * getRenderTargets()=0
Get a pointer to the render target management interface.
virtual ISwapChain * getDefaultSwapChain()=0
Get a pointer to the default swap chain for this graphics device.
virtual IPipelineStates * getPipelineStates()=0
Get a pointer to the pipeline state management interface.
virtual bool initializeThread()
Initialize the graphics device for operation on the current thread.
Contains all Cogs related functionality.
GraphicsDeviceType
Contains types of graphics devices that may be supported.
@ Unknown
Unknown type of graphics device.
GraphicsDeviceFlags
Flags controlling the behavior of a graphics device.
@ ForceSoftwareRendering
Force software rendering.
@ UseESCompatibility
Instead of creating an ES2 context via WGL, create a full GL context and check for ARB_ES2_compatibil...
@ DumpShaderContents
Dump shader contents for debugging.
@ EnableDiagnostics
If available, the device will print diagnostic information to the log.
@ EnableShaderCache
Enables using a shader cache to avoid recompiling previously seen shaders.
@ UseOpenGLClipControl
For OpenGL / OpenGLES backends.
@ Debug
If available, the device will operate in debug mode, performing additional validation of input data,...
@ EnableTraceLogging
Enables trace logging.
@ UseSwapEffectDiscard
Under DX11 the default swap effect is FLIP_DISCARD, however there are some systems where this does no...
@ UseSharedSurface
Use shared surface for D3D9 interop.
Settings for graphics device initialization.
int featureLevelMajor
Major feature level.
TextureFormat depthFormat
Depth buffer format.
int numSamples
Number of samples to use for back buffer MSAA.
void ** sharedSurface
Pointer to storage for a pointer to a shared surface.
struct WindowData * windowData
Native window handle used to initialize the graphics device.
int featureLevelMinor
Minor feature level.
int flags
Flags controlling the behavior of the graphics device.
IIOHandler * ioHandler
Optional pointer to an IO handler.
TextureFormat colorFormat
Back buffer format.
Provides buffer management functionality.
Provides capability query functionality.
Represents a graphics device context which can receive rendering commands.
Provides effects and shader management functionality.
Provides render target management functionality.
Provides sync object management.
Provides texture management functionality.