Cogs.Rendering
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Cogs::Factory Struct Reference

Graphics device construction factory. More...

#include <Factory.h>

Static Public Member Functions

static class IGraphicsDevicecreateDevice (RenderingAllocatorInfo *allocatorInfo=nullptr)
 Creates a graphics device.
 
static class IGraphicsDevicecreateDevice (const StringView &name)
 Creates a graphics device with the given type.
 
static class IGraphicsDevicecreateDevice (const GraphicsDeviceType &type, RenderingAllocatorInfo *allocatorInfo=nullptr)
 Creates a graphics device with the given type.
 
static void releaseDevice (class IGraphicsDevice *device)
 Release the given graphics device, freeing all associated resources.
 

Detailed Description

Graphics device construction factory.

Member Function Documentation

◆ createDevice() [1/3]

Cogs::IGraphicsDevice * Cogs::Factory::createDevice ( const GraphicsDeviceType type,
RenderingAllocatorInfo allocatorInfo = nullptr 
)
static

Creates a graphics device with the given type.

Parameters
typeType of graphics device to create.
allocatorInfoOptional pointer to allocation information.
Returns
A pointer to the graphics device interface, nullptr if the operation failed or if the given type is not supported by the current build.

References Cogs::Direct3D11, Cogs::Direct3D12, Cogs::Null, Cogs::OpenGL20, Cogs::OpenGLES30, Cogs::Unknown, Cogs::Vulkan, and Cogs::WebGPU.

◆ createDevice() [2/3]

Cogs::IGraphicsDevice * Cogs::Factory::createDevice ( const StringView &  name)
static

Creates a graphics device with the given type.

Parameters
nameName of the graphics device type. Valid names are (depending on the current build) OpenGL20, Direct3D11, OpenGLES30.
Returns
A pointer to the graphics device interface, nullptr if the operation failed.

References Cogs::Direct3D11, Cogs::Direct3D12, Cogs::Null, Cogs::OpenGL20, Cogs::OpenGLES30, Cogs::Vulkan, and Cogs::WebGPU.

◆ createDevice() [3/3]

Cogs::IGraphicsDevice * Cogs::Factory::createDevice ( RenderingAllocatorInfo allocatorInfo = nullptr)
static

Creates a graphics device.

The device type is determined from the built in supported types.

Parameters
allocatorInfoOptional pointer to allocation information.
Returns
A pointer to the graphics device interface, nullptr if the operation failed.

References createDevice(), Cogs::Direct3D11, Cogs::Direct3D12, Cogs::Null, Cogs::OpenGL20, Cogs::OpenGLES30, Cogs::Vulkan, and Cogs::WebGPU.

Referenced by createDevice().

◆ releaseDevice()

void Cogs::Factory::releaseDevice ( class IGraphicsDevice device)
static

Release the given graphics device, freeing all associated resources.

Parameters
devicePointer to a graphics device.

References Cogs::Direct3D11, Cogs::Direct3D12, Cogs::IGraphicsDevice::getType(), Cogs::Null, Cogs::OpenGL20, Cogs::OpenGLES30, Cogs::Vulkan, Cogs::WebGPU, and Cogs::IGraphicsDevice::~IGraphicsDevice().


The documentation for this struct was generated from the following files: