Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
DriverBase Class Referenceabstract

New or create resources from DriverBase. More...

#include <DriverBase.h>

Inherited by DriverGL, and DriverMTL.

Public Member Functions

virtual CommandBuffernewCommandBuffer ()=0
 New a CommandBuffer object, not auto released.
 
virtual BuffernewBuffer (size_t size, BufferType type, BufferUsage usage)=0
 New a Buffer object, not auto released.
 
virtual TextureBackendnewTexture (const TextureDescriptor &descriptor)=0
 New a TextureBackend object, not auto released.
 
virtual RenderPipelinenewRenderPipeline ()=0
 New a RenderPipeline object, not auto released.
 
virtual void setFrameBufferOnly (bool frameBufferOnly)=0
 This property controls whether or not the drawables' metal textures may only be used for framebuffer attachments (YES) or whether they may also be used for texture sampling and pixel read/write operations (NO).
 
virtual ProgramnewProgram (std::string_view vertexShader, std::string_view fragmentShader)=0
 Create an auto released Program.
 
virtual const char * getVendor () const =0
 below is driver info
 
virtual const char * getRenderer () const =0
 Get the full name of the vendor device.
 
virtual const char * 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.
 

Static Public Member Functions

static DriverBasegetInstance ()
 Returns a shared instance of the DriverBase.
 

Detailed Description

New or create resources from DriverBase.

Member Function Documentation

◆ newCommandBuffer()

virtual CommandBuffer * newCommandBuffer ( )
pure virtual

New a CommandBuffer object, not auto released.

Returns
A CommandBuffer object.

Implemented in DriverGL, and DriverMTL.

◆ newBuffer()

virtual Buffer * newBuffer ( size_t size,
BufferType type,
BufferUsage usage )
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.

◆ newTexture()

virtual TextureBackend * newTexture ( const TextureDescriptor & descriptor)
pure virtual

New a TextureBackend object, not auto released.

Parameters
descriptorSpecifies texture description.
Returns
A TextureBackend object.

Implemented in DriverGL, and DriverMTL.

◆ newRenderPipeline()

virtual RenderPipeline * newRenderPipeline ( )
pure virtual

New a RenderPipeline object, not auto released.

Parameters
descriptorSpecifies render pipeline description.
Returns
A RenderPipeline object.

Implemented in DriverGL, and DriverMTL.

◆ setFrameBufferOnly()

virtual void setFrameBufferOnly ( bool frameBufferOnly)
pure virtual

This property controls whether or not the drawables' metal textures may only be used for framebuffer attachments (YES) or whether they may also be used for texture sampling and pixel read/write operations (NO).

Parameters
frameBufferOnlyA value of YES allows CAMetalLayer to allocate the MTLTexture objects in ways that are optimized for display purposes that makes them unsuitable for sampling. The recommended value for most applications is YES.
Note
This interface is specificaly designed for metal.

Implemented in DriverGL, and DriverMTL.

◆ newProgram()

virtual Program * newProgram ( std::string_view vertexShader,
std::string_view fragmentShader )
pure virtual

Create an auto released Program.

Parameters
vertexShaderSpecifes this is a vertex shader source.
fragmentShaderSpecifes this is a fragment shader source.
Returns
A Program instance.

Implemented in DriverGL, and DriverMTL.

◆ getVendor()

virtual const char * getVendor ( ) const
pure virtual

below is driver info

Get vendor device name.

Returns
Vendor device name.

Implemented in DriverGL, and DriverMTL.

◆ getRenderer()

virtual const char * getRenderer ( ) const
pure virtual

Get the full name of the vendor device.

Returns
The full name of the vendor device.

Implemented in DriverGL, and DriverMTL.

◆ getVersion()

virtual const char * getVersion ( ) const
pure virtual

Get version name.

Returns
Version name.

Implemented in DriverGL, and DriverMTL.

◆ 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 DriverGL, and DriverMTL.

◆ 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.

The documentation for this class was generated from the following file: