⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.

Axmol Engine 3.0.0-84160d4
Loading...
Searching...
No Matches
Program Class Referenceabstract

A program. More...

#include <Program.h>

Inherits Object.

Inherited by ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

Public Member Functions

virtual UniformLocation getUniformLocation (std::string_view uniform) const =0
 Get uniform location by name.
virtual UniformLocation getUniformLocation (rhi::Uniform name) const =0
 Get uniform location by engine built-in uniform enum name.
virtual const VertexInputDesc * getVertexInputDesc (std::string_view name) const =0
 Get attribute location by attribute name.
virtual const VertexInputDesc * getVertexInputDesc (rhi::VertexInputKind name) const =0
 Get attribute location by engine built-in attribute enum name.
virtual int getMaxVertexLocation () const =0
 Get maximum vertex location.
virtual int getMaxFragmentLocation () const =0
 Get maximum fragment location.
virtual const tlx::string_map< VertexInputDesc > & getActiveVertexInputs () const =0
 Get active vertex attributes.
std::string_view getVertexShaderSource () const
 Get vertex shader.
std::string_view getFragmentShaderSource () const
 Get fragment shader.
uint32_t getProgramType () const
 Get engine built-in program type.
uint64_t getProgramId () const
 Get program id.
virtual std::size_t getUniformBufferSize (ShaderStage stage) const =0
 Get uniform buffer size in bytes that can hold all the uniforms.
virtual const tlx::string_map< UniformInfo > & getActiveUniformInfos (ShaderStage stage) const =0
 Get all uniformInfos.
Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
void release ()
 Releases the ownership immediately.
Objectautorelease ()
 Releases the ownership sometime soon automatically.
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
virtual ~Object ()
 Destructor.

Additional Inherited Members

Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
int _luaID
 Lua reference id.

Detailed Description

A program.

Member Function Documentation

◆ getUniformLocation() [1/2]

virtual UniformLocation getUniformLocation ( std::string_view uniform) const
pure virtual

Get uniform location by name.

Parameters
uniformSpecifies the uniform name.
Returns
The uniform location.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getUniformLocation() [2/2]

virtual UniformLocation getUniformLocation ( rhi::Uniform name) const
pure virtual

Get uniform location by engine built-in uniform enum name.

Parameters
nameSpecifies the engine built-in uniform enum name.
Returns
The uniform location.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getVertexInputDesc() [1/2]

virtual const VertexInputDesc * getVertexInputDesc ( std::string_view name) const
pure virtual

Get attribute location by attribute name.

Parameters
nameSpecifies the attribute name.
Returns
The attribute location.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getVertexInputDesc() [2/2]

virtual const VertexInputDesc * getVertexInputDesc ( rhi::VertexInputKind name) const
pure virtual

Get attribute location by engine built-in attribute enum name.

Parameters
nameSpecifies the engine built-in attribute enum name.
Returns
The attribute location.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getMaxVertexLocation()

virtual int getMaxVertexLocation ( ) const
pure virtual

Get maximum vertex location.

Returns
Maximum vertex locaiton.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getMaxFragmentLocation()

virtual int getMaxFragmentLocation ( ) const
pure virtual

Get maximum fragment location.

Returns
Maximum fragment location.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getActiveVertexInputs()

virtual const tlx::string_map< VertexInputDesc > & getActiveVertexInputs ( ) const
pure virtual

Get active vertex attributes.

Returns
Active vertex attributes. key is active attribute name, Value is corresponding attribute info.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getVertexShaderSource()

std::string_view getVertexShaderSource ( ) const
inline

Get vertex shader.

Returns
Vertex shader.

◆ getFragmentShaderSource()

std::string_view getFragmentShaderSource ( ) const
inline

Get fragment shader.

@ Fragment shader.

◆ getProgramType()

uint32_t getProgramType ( ) const
inline

Get engine built-in program type.

Returns
The built-in program type.

◆ getProgramId()

uint64_t getProgramId ( ) const
inline

Get program id.

Returns
The program id.

◆ getUniformBufferSize()

virtual std::size_t getUniformBufferSize ( ShaderStage stage) const
pure virtual

Get uniform buffer size in bytes that can hold all the uniforms.

Parameters
stageSpecifies the shader stage. The symbolic constant can be either VERTEX or FRAGMENT.
Returns
The uniform buffer size in bytes.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.

◆ getActiveUniformInfos()

virtual const tlx::string_map< UniformInfo > & getActiveUniformInfos ( ShaderStage stage) const
pure virtual

Get all uniformInfos.

Returns
The uniformInfos.

Implemented in ProgramImpl, ProgramImpl, ProgramImpl, ProgramImpl, and ProgramImpl.


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