Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
GraphicsDevice Class Referenceabstract

New or create resources from GraphicsDevice. More...

#include <GraphicsDevice.h>

Inherited by GraphicsDeviceImpl, , and GraphicsDeviceImpl.

Public Member Functions

virtual GraphicsContext * createGraphicsContext (SurfaceHandle surface)=0
 Create a GraphicsContext (not auto‑released).
virtual Buffer * createBuffer (size_t size, BufferType type, BufferUsage usage, const void *inital=nullptr)=0
 New a Buffer object, not auto released.
virtual Texture * createTexture (const TextureDesc &descriptor, std::optional< Color > clearColorHint=std::nullopt)=0
 New a Texture object with a render-target clear color hint, not auto released.
virtual Texture * createTextureFromNativeHandle (const ExternalTextureDesc &descriptor)=0
 Wrap a backend-native texture owned by an external runtime, not auto released.
virtual GraphicsPipeline * createGraphicsPipeline ()=0
 New a GraphicsPipeline object, not auto released.
virtual ComputePipeline * createComputePipeline (Program *program)=0
 Create a compute pipeline from a compute program, not auto released.
virtual Program * createProgram (Data vsData, Data fsData)=0
 Create an auto released Program.
virtual std::string getVendor () const =0
 below is driver info
virtual std::string getRenderer () const =0
 Get the full name of the vendor device.
virtual std::string getVersion () const =0
 Get version name.
virtual bool hasExtension (std::string_view) const
 Check does device has extension.
virtual std::string dumpExtensions () const
 Dump all extensions to string.
virtual bool checkForFeatureSupported (FeatureType feature)=0
 Check if feature supported by device.
int getMaxTextureSize () const
 Get maximum texture size.
int getMaxAttributes () const
 Get maximum attribute counts.
int getMaxTextureUnits () const
 Get maximum texture unit.
int getMaxSamplesAllowed () const
 Get maximum sampler count.

Friends

class GraphicsCore
 Shorthand for ax::rhi::GraphicsCore.

Detailed Description

New or create resources from GraphicsDevice.

Member Function Documentation

◆ createGraphicsContext()

virtual GraphicsContext * createGraphicsContext ( SurfaceHandle surface)
pure virtual

Create a GraphicsContext (not auto‑released).

Parameters
surfaceHandlePlatform-specific surface:
  • Win32: HWND
  • UWP: IUnknown* (SwapChainPanel)
  • Vulkan: VkSurfaceKHR
Returns
GraphicsContext instance

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ createBuffer()

virtual Buffer * createBuffer ( size_t size,
BufferType type,
BufferUsage usage,
const void * inital = nullptr )
pure virtual

New a Buffer object, not auto released.

Parameters
sizeSpecifies the size in bytes of the buffer object's new data store.
typeSpecifies the target buffer object. The symbolic constant must be BufferType::VERTEX or BufferType::INDEX.
usageSpecifies the expected usage pattern of the data store. The symbolic constant must be BufferUsage::STATIC, BufferUsage::DYNAMIC.
Returns
A Buffer object.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ createTexture()

virtual Texture * createTexture ( const TextureDesc & descriptor,
std::optional< Color > clearColorHint = std::nullopt )
pure virtual

New a Texture object with a render-target clear color hint, not auto released.

Parameters
descriptorSpecifies texture description.
clearColorHintOptional render-target clear color hint. D3D12 uses it as D3D12_CLEAR_VALUE metadata for optimized ClearRenderTargetView operations. Other backends ignore it.
Returns
A Texture object.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ createGraphicsPipeline()

virtual GraphicsPipeline * createGraphicsPipeline ( )
pure virtual

New a GraphicsPipeline object, not auto released.

Parameters
descriptorSpecifies render pipeline description.
Returns
A GraphicsPipeline object.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ createComputePipeline()

virtual ComputePipeline * createComputePipeline ( Program * program)
pure virtual

Create a compute pipeline from a compute program, not auto released.

Parameters
programSpecifies the compute program.
Returns
A ComputePipeline object.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ createProgram()

virtual Program * createProgram ( Data vsData,
Data fsData )
pure virtual

Create an auto released Program.

Parameters
vsDataSpecifes this is a vertex shader data.
fsDataSpecifes this is a fragment shader data.
Returns
A Program instance.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ getVendor()

virtual std::string getVendor ( ) const
pure virtual

below is driver info

Get vendor device name.

Returns
Vendor device name.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ getRenderer()

virtual std::string getRenderer ( ) const
pure virtual

Get the full name of the vendor device.

Returns
The full name of the vendor device.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ getVersion()

virtual std::string getVersion ( ) const
pure virtual

Get version name.

Returns
Version name.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ checkForFeatureSupported()

virtual bool checkForFeatureSupported ( FeatureType feature)
pure virtual

Check if feature supported by device.

Parameters
featureSpecify feature to be query.
Returns
true if the feature is supported, false otherwise.

Implemented in GraphicsDeviceImpl, GraphicsDeviceImpl, and GraphicsDeviceImpl.

◆ getMaxTextureSize()

int getMaxTextureSize ( ) const
inline

Get maximum texture size.

Returns
Maximum texture size.

◆ getMaxAttributes()

int getMaxAttributes ( ) const
inline

Get maximum attribute counts.

Returns
Maximum attribute counts.

◆ getMaxTextureUnits()

int getMaxTextureUnits ( ) const
inline

Get maximum texture unit.

Returns
Maximum texture unit.

◆ getMaxSamplesAllowed()

int getMaxSamplesAllowed ( ) const
inline

Get maximum sampler count.

Returns
Maximum sampler count.

◆ GraphicsCore

friend class GraphicsCore
friend

Shorthand for ax::rhi::GraphicsCore.

GraphicsCore manages the rendering backend selection, device lifecycle, and graphics runtime state for the engine.


The documentation for this class was generated from the following file:
  • GraphicsDevice.h