Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
ProgramGL Class Reference

An OpenGL program. More...

#include <ProgramGL.h>

Inherits Program.

Public Member Functions

 ProgramGL (std::string_view vertexShader, std::string_view fragmentShader)
 
const std::vector< AttributeInfo > & getAttributeInfos () const
 Get attribute informations.
 
GLuint getHandler () const
 Get program object.
 
virtual UniformLocation getUniformLocation (std::string_view 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 (std::string_view 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 int getMaxVertexLocation () const override
 Get maximum vertex location.
 
virtual int getMaxFragmentLocation () const override
 Get maximum fragment location.
 
virtual const hlookup::string_map< AttributeBindInfo > & getActiveAttributes () const override
 Get active vertex attributes.
 
virtual std::size_t getUniformBufferSize (ShaderStage stage) const override
 Get uniform buffer size in bytes that can hold all the uniforms.
 
virtual const hlookup::string_map< UniformInfo > & getAllActiveUniformInfo (ShaderStage stage) const override
 Get all uniformInfos.
 
- Public Member Functions inherited from Program
std::string_view getVertexShader () const
 Get vertex shader.
 
std::string_view getFragmentShader () const
 Get fragment shader.
 
void setupVertexLayout (VertexLayoutType vlt)
 Sets the program shared vertex layout type, see: VertexLayoutType.
 
uint32_t getProgramType () const
 Get engine built-in program type.
 
uint64_t getProgramId () const
 Get program id.
 
- 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

- Static Public Member Functions inherited from Program
static ProgramgetBuiltinProgram (uint32_t type)
 Get engine built-in program.
 
- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 

Detailed Description

An OpenGL program.

Constructor & Destructor Documentation

◆ ProgramGL()

ProgramGL ( std::string_view vertexShader,
std::string_view fragmentShader )
Parameters
vertexShaderSpecifes the vertex shader source.
fragmentShaderSpecifes the fragment shader source.

Member Function Documentation

◆ getAttributeInfos()

const std::vector< AttributeInfo > & getAttributeInfos ( ) const
inline

Get attribute informations.

Returns
Attribute informations.

◆ getHandler()

GLuint getHandler ( ) const
inline

Get program object.

Returns
Program object.

◆ getUniformLocation() [1/2]

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

Get uniform location by name.

Parameters
uniformSpecifies the uniform name.
Returns
The uniform location.

Implements Program.

◆ getUniformLocation() [2/2]

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.

◆ getAttributeLocation() [1/2]

virtual int getAttributeLocation ( std::string_view name) const
overridevirtual

Get attribute location by attribute name.

Parameters
nameSpecifies the attribute name.
Returns
The attribute location.

Implements Program.

◆ getAttributeLocation() [2/2]

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.

◆ getMaxVertexLocation()

virtual int getMaxVertexLocation ( ) const
overridevirtual

Get maximum vertex location.

Returns
Maximum vertex locaiton.

Implements Program.

◆ getMaxFragmentLocation()

virtual int getMaxFragmentLocation ( ) const
overridevirtual

Get maximum fragment location.

Returns
Maximum fragment location.

Implements Program.

◆ getActiveAttributes()

virtual const hlookup::string_map< AttributeBindInfo > & getActiveAttributes ( ) const
overridevirtual

Get active vertex attributes.

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

Implements Program.

◆ getUniformBufferSize()

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.

◆ getAllActiveUniformInfo()

virtual const hlookup::string_map< 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: