Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
GraphicsDeviceImpl Class Reference

Create resources from MTLDevice. More...

#include <GraphicsDeviceMTL.h>

Inherits GraphicsDevice.

Public Member Functions inherited from GraphicsDevice
virtual bool hasExtension (std::string_view) const
 Check does device has extension.
virtual std::string dumpExtensions () const
 Dump all extensions to string.
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.

Setters & Getters

below is driver info

GraphicsContext * createGraphicsContext (SurfaceHandle) override
 New a GraphicsContext object.
Buffer * createBuffer (size_t size, BufferType type, BufferUsage usage, const void *initial) override
 New a Buffer object.
Texture * createTexture (const TextureDesc &descriptor, std::optional< Color > clearColorHint=std::nullopt) override
 New a Texture object.
Texture * createTextureFromNativeHandle (const ExternalTextureDesc &descriptor) override
 Wrap a backend-native texture owned by an external runtime, not auto released.
DepthStencilState * createDepthStencilState () override
 New a DepthStencilState object.
GraphicsPipeline * createGraphicsPipeline () override
 New a GraphicsPipeline object.
ComputePipeline * createComputePipeline (Program *program) override
 Create a compute pipeline from a compute program, not auto released.
Program * createProgram (Data vsData, Data fsData) override
 Create an auto released Program.
id< MTLDevice > getMTLDevice () const
 Get a MTLDevice object.
std::string getVendor () const override
 Get vendor device name.
std::string getRenderer () const override
 Get the full name of the vendor device.
std::string getVersion () const override
 Get featureSet name.
bool checkForFeatureSupported (FeatureType feature) override
 Check if feature supported by Metal.

Detailed Description

Create resources from MTLDevice.

Member Function Documentation

◆ createGraphicsContext()

GraphicsContext * createGraphicsContext ( SurfaceHandle )
overridevirtual

New a GraphicsContext object.

Returns
A GraphicsContext object.

Implements GraphicsDevice.

◆ createBuffer()

Buffer * createBuffer ( size_t size,
BufferType type,
BufferUsage usage,
const void * initial )
overridevirtual

New a Buffer object.

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.

Implements GraphicsDevice.

◆ createTexture()

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

New a Texture object.

Parameters
descriptorSpecifies texture description.
Returns
A Texture object.

Implements GraphicsDevice.

◆ createGraphicsPipeline()

GraphicsPipeline * createGraphicsPipeline ( )
overridevirtual

New a GraphicsPipeline object.

Parameters
descriptorSpecifies render pipeline description.
Returns
A GraphicsPipeline object.

Implements GraphicsDevice.

◆ createComputePipeline()

ComputePipeline * createComputePipeline ( Program * program)
overridevirtual

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

Parameters
programSpecifies the compute program.
Returns
A ComputePipeline object.

Implements GraphicsDevice.

◆ createProgram()

Program * createProgram ( Data vsData,
Data fsData )
overridevirtual

Create an auto released Program.

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

Implements GraphicsDevice.

◆ getMTLDevice()

id< MTLDevice > getMTLDevice ( ) const
inline

Get a MTLDevice object.

Returns
A MTLDevice object.

◆ getVendor()

std::string getVendor ( ) const
overridevirtual

Get vendor device name.

Returns
Vendor device name.

Implements GraphicsDevice.

◆ getRenderer()

std::string getRenderer ( ) const
overridevirtual

Get the full name of the vendor device.

Returns
The full name of the vendor device.

Implements GraphicsDevice.

◆ getVersion()

std::string getVersion ( ) const
overridevirtual

Get featureSet name.

Returns
FeatureSet name.

Implements GraphicsDevice.

◆ checkForFeatureSupported()

bool checkForFeatureSupported ( FeatureType feature)
overridevirtual

Check if feature supported by Metal.

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

Implements GraphicsDevice.


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