Cocos2d-x  4.0.0
List of all members
ProgramMTL Class Reference

A metal Program. More...

Inherits Program.

Constructor, Destructor and Initializers

 ProgramMTL (const std::string &vertexShader, const std::string &fragmentShader)
 
virtual ~ProgramMTL ()
 
virtual UniformLocation getUniformLocation (const std::string &uniform) const override
 Get uniform location by name.
 
virtual UniformLocation getUniformLocation (backend::Uniform name) const override
 Get uniform location by engine built-in uniform enum name.
 
virtual int getAttributeLocation (const std::string &name) const override
 Get attribute location by attribute name.
 
virtual int getAttributeLocation (Attribute name) const override
 Get attribute location by engine built-in attribute enum name.
 
virtual ShaderModuleMTLgetVertexShader () const
 Get vertex shader module.
 
virtual ShaderModuleMTLgetFragmentShader () const
 Get fragment shader module.
 
const std::unordered_map
< std::string,
AttributeBindInfo > 
getActiveAttributes () const override
 Get active vertex attributes.
 
virtual int getMaxVertexLocation () const override
 Get maximum vertex location.
 
virtual int getMaxFragmentLocation () const override
 Get maximum fragment location.
 
virtual std::size_t getUniformBufferSize (ShaderStage stage) const override
 Get uniform buffer size in bytes that can hold all the uniforms.
 
virtual const UniformInfo & getActiveUniformInfo (ShaderStage stage, int location) const override
 Get a uniformInfo in given location from the specific shader stage.
 
virtual const
std::unordered_map
< std::string, UniformInfo > & 
getAllActiveUniformInfo (ShaderStage stage) const override
 Get all uniformInfos.
 

Additional Inherited Members

- Public Member Functions inherited from Program
const std::string & getVertexShader () const
 Get vertex shader.
 
const std::string & getFragmentShader () const
 Get fragment shader.
 
ProgramType getProgramType () const
 Get engine built-in program type.
 
- Static Public Member Functions inherited from Program
static ProgramgetBuiltinProgram (ProgramType type)
 Get engine built-in program.
 
- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

A metal Program.

Constructor & Destructor Documentation

ProgramMTL ( const std::string &  vertexShader,
const std::string &  fragmentShader 
)
Parameters
vertexShaderSpecifes the vertex shader source.
fragmentShaderSpecifes the fragment shader source.

Member Function Documentation

virtual UniformLocation getUniformLocation ( const std::string &  uniform) const
overridevirtual

Get uniform location by name.

Parameters
uniformSpecifies the uniform name.
Returns
The uniform location.

Implements Program.

virtual UniformLocation getUniformLocation ( backend::Uniform  name) const
overridevirtual

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

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

Implements Program.

virtual int getAttributeLocation ( const std::string &  name) const
overridevirtual

Get attribute location by attribute name.

Parameters
nameSpecifies the attribute name.
Returns
The attribute location.

Implements Program.

virtual int getAttributeLocation ( Attribute  name) const
overridevirtual

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

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

Implements Program.

virtual ShaderModuleMTL* getVertexShader ( ) const
inlinevirtual

Get vertex shader module.

Returns
Vertex shader module.
virtual ShaderModuleMTL* getFragmentShader ( ) const
inlinevirtual

Get fragment shader module.

@ Fragment shader module.

const std::unordered_map<std::string, AttributeBindInfo> getActiveAttributes ( ) const
overridevirtual

Get active vertex attributes.

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

Implements Program.

virtual int getMaxVertexLocation ( ) const
overridevirtual

Get maximum vertex location.

Returns
Maximum vertex locaiton.

Implements Program.

virtual int getMaxFragmentLocation ( ) const
overridevirtual

Get maximum fragment location.

Returns
Maximum fragment location.

Implements Program.

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

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.

Implements Program.

virtual const UniformInfo& getActiveUniformInfo ( ShaderStage  stage,
int  location 
) const
overridevirtual

Get a uniformInfo in given location from the specific shader stage.

Parameters
stageSpecifies the shader stage. The symbolic constant can be either VERTEX or FRAGMENT.
locationSpecifies the uniform locaion.
Returns
The uniformInfo.

Implements Program.

virtual const std::unordered_map<std::string, UniformInfo>& getAllActiveUniformInfo ( ShaderStage  stage) const
overridevirtual

Get all uniformInfos.

Returns
The uniformInfos.

Implements Program.


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