public

Inheritance Graph

graph BT
	Shader
	Shader --> ReferenceCounter
	click Shader "classRendering_1_1Shader"
	click ReferenceCounter "classUtil_1_1ReferenceCounter"

Description

Shader

Main

   
   
typedef uint32_t flag_t
   
const flag_t USE_GL
   
const flag_t USE_UNIFORMS
   
  ~Shader()
   
bool _enable()
(internal) called by RenderingContext
   
bool enable( RenderingContext & rc)
   
bool isActive( RenderingContext & rc)
   
bool usesClassicOpenGL() const
   
bool usesSGUniforms() const
   
void setUsage( flag_t newUsage)
   
RenderingStatus * getRenderingStatus()

(static) Factories

   
   
Shader * loadShader(const Util::FileName & vsFile, const Util::FileName & fsFile, flag_t usage)
   
Shader * loadShader(const Util::FileName & vsFile, const Util::FileName & gsFile, const Util::FileName & fsFile, flag_t usage)
   
Shader * createShader( flag_t usage)
   
Shader * createShader(const std::string & vsa, const std::string & fsa, flag_t usage)
   
Shader * createShader(const std::string & vsa, const std::string & gsa, const std::string & fsa, flag_t usage)

Program and status

   
   
enum status_t {UNKNOWN, COMPILED, LINKED, INVALID}
   
status_t getStatus() const
   
uint32_t getShaderProg() const
   
bool init()
Try to transfer the shader into LINKED-state. Returns true on success.

Shader Objects

   
   
void attachShaderObject( ShaderObjectInfo && obj)

Uniforms

   
   
UniformRegistry * _getUniformRegistry() const
(internal) should only be used by renderingContext
   
void applyUniforms(bool forced)
   
bool isUniform(const Util::StringIdentifier name)
   
void getActiveUniforms(std::vector< Uniform > & uniforms)
   
const Uniform & getUniform(const Util::StringIdentifier name)
   
void setUniform( RenderingContext & rc, const Uniform & uniform, bool warnIfUnused, bool forced)

Vertex attributes

   
   
void defineVertexAttribute(const std::string & attrName, uint32_t index)
   
int32_t getVertexAttributeLocation( Util::StringIdentifier attrName)

Transform Feedback

   
   
void setInterleavedFeedbackVaryings(const std::vector< std::string > & names)
   
void setSeparateFeedbackVaryings(const std::vector< std::string > & names)

Shader Subroutines

   
   
int32_t getSubroutineIndex(uint32_t stage, const std::string & name)

Documentation

typedef
Rendering::Shader::flag_t

public
 
 
typedef uint32_t flag_t

Defined in Rendering/Shader/Shader.h:47


variable
Rendering::Shader::USE_GL

public static
 
 
const flag_t USE_GL

Defined in Rendering/Shader/Shader.h:48


variable
Rendering::Shader::USE_UNIFORMS

public static
 
 
const flag_t USE_UNIFORMS

Defined in Rendering/Shader/Shader.h:49


function
Rendering::Shader::~Shader

public
   
   
~Shader( )

Defined in Rendering/Shader/Shader.h:51


function
Rendering::Shader::_enable

public
   
   
bool _enable( )

(internal) called by RenderingContext

Defined in Rendering/Shader/Shader.h:54


function
Rendering::Shader::enable

public
     
     
bool enable( RenderingContext & rc )

Sets the active shader at the renderingContext. If the shader has not been linked, it is linked.

Returns

returns true if the status of the shader is LINKED

Defined in Rendering/Shader/Shader.h:59


function
Rendering::Shader::isActive

public
     
     
bool isActive( RenderingContext & rc )

Defined in Rendering/Shader/Shader.h:60


function
Rendering::Shader::usesClassicOpenGL

public const inline
   
   
bool usesClassicOpenGL( ) const

Defined in Rendering/Shader/Shader.h:62


function
Rendering::Shader::usesSGUniforms

public const inline
   
   
bool usesSGUniforms( ) const

Defined in Rendering/Shader/Shader.h:63


function
Rendering::Shader::setUsage

public inline
     
     
void setUsage( flag_t newUsage )

Defined in Rendering/Shader/Shader.h:64


function
Rendering::Shader::getRenderingStatus

public inline
   
   
RenderingStatus * getRenderingStatus( )

Defined in Rendering/Shader/Shader.h:66


function
Rendering::Shader::loadShader

public static
     
     
Shader * loadShader( const Util::FileName & vsFile,
  const Util::FileName & fsFile,
  flag_t usage
)    

Defined in Rendering/Shader/Shader.h:81


function
Rendering::Shader::loadShader

public static
     
     
Shader * loadShader( const Util::FileName & vsFile,
  const Util::FileName & gsFile,
  const Util::FileName & fsFile,
  flag_t usage
)    

Defined in Rendering/Shader/Shader.h:82


function
Rendering::Shader::createShader

public static
     
     
Shader * createShader( flag_t usage )

Defined in Rendering/Shader/Shader.h:83


function
Rendering::Shader::createShader

public static
     
     
Shader * createShader( const std::string & vsa,
  const std::string & fsa,
  flag_t usage
)    

Defined in Rendering/Shader/Shader.h:84


function
Rendering::Shader::createShader

public static
     
     
Shader * createShader( const std::string & vsa,
  const std::string & gsa,
  const std::string & fsa,
  flag_t usage
)    

Defined in Rendering/Shader/Shader.h:85


enum
Rendering::Shader::status_t

public
 
 
enum status_t
Enumerator   Description
Enumerator   Description
UNKNOWN = 0  
COMPILED = 1  
LINKED = 2  
INVALID = 3  

Defined in Rendering/Shader/Shader.h:93


function
Rendering::Shader::getStatus

public const inline
   
   
status_t getStatus( ) const

Defined in Rendering/Shader/Shader.h:99


function
Rendering::Shader::getShaderProg

public const inline
   
   
uint32_t getShaderProg( ) const

Defined in Rendering/Shader/Shader.h:100


function
Rendering::Shader::init

public
   
   
bool init( )

Try to transfer the shader into LINKED-state. Returns true on success.

Defined in Rendering/Shader/Shader.h:103


function
Rendering::Shader::attachShaderObject

public
     
     
void attachShaderObject( ShaderObjectInfo && obj )

Defined in Rendering/Shader/Shader.h:127


function
Rendering::Shader::_getUniformRegistry

public const inline
   
   
UniformRegistry * _getUniformRegistry( ) const

(internal) should only be used by renderingContext

Defined in Rendering/Shader/Shader.h:151


function
Rendering::Shader::applyUniforms

public
     
     
void applyUniforms( bool forced )

Apply those uniforms stored in the internal uniformRegistry to the shader, that have been changed since the last call to this function (or all, if forced is true).

Note: The Shader needs not to be active.

Defined in Rendering/Shader/Shader.h:156


function
Rendering::Shader::isUniform

public
     
     
bool isUniform( const Util::StringIdentifier name )

Defined in Rendering/Shader/Shader.h:158


function
Rendering::Shader::getActiveUniforms

public
     
     
void getActiveUniforms( std::vector< Uniform > & uniforms )

Get the values of all uniforms defined in the shader’s program.

Note: The Shader needs not to be active.

Defined in Rendering/Shader/Shader.h:162


function
Rendering::Shader::getUniform

public
     
     
const Uniform & getUniform( const Util::StringIdentifier name )

Get the value of the uniform with the given name. If the name is not defined in the shader’s program, the resulting Uniform is null (uniform.isNull()==true).

Note: The Shader needs not to be active.

Defined in Rendering/Shader/Shader.h:167


function
Rendering::Shader::setUniform

public
     
     
void setUniform( RenderingContext & rc,
  const Uniform & uniform,
  bool warnIfUnused,
  bool forced
)    

Set an Uniform . The uniform is applied when the shader is active and the renderingContext’s changes are applied.

Note: The uniform is stored at the Shader ‘s internal uniformRegistry.

Note: The Shader needs not to be active.

Defined in Rendering/Shader/Shader.h:172


function
Rendering::Shader::defineVertexAttribute

public
     
     
void defineVertexAttribute( const std::string & attrName,
  uint32_t index
)    

Defined in Rendering/Shader/Shader.h:182


function
Rendering::Shader::getVertexAttributeLocation

public
     
     
int32_t getVertexAttributeLocation( Util::StringIdentifier attrName )

Defined in Rendering/Shader/Shader.h:183


function
Rendering::Shader::setInterleavedFeedbackVaryings

public
     
     
void setInterleavedFeedbackVaryings( const std::vector< std::string > & names )

Defined in Rendering/Shader/Shader.h:192


function
Rendering::Shader::setSeparateFeedbackVaryings

public
     
     
void setSeparateFeedbackVaryings( const std::vector< std::string > & names )

Defined in Rendering/Shader/Shader.h:193


function
Rendering::Shader::getSubroutineIndex

public
     
     
int32_t getSubroutineIndex( uint32_t stage,
  const std::string & name
)    

Defined in Rendering/Shader/Shader.h:203