GL Studio C++ Runtime API
IGlsEffectFactory Interface Referenceabstract

#include <gls_es20_effect_factory_interface.h>

Public Types

enum  ShaderOptions_e {
  SHADER_LIGHTING_BIT = 1 << 0 , SHADER_CLIP_PLANES_BIT = 1 << 1 , SHADER_TEXTURE_BLEND_BIT = 1 << 2 , SHADER_TEXTURE_MODULATE_BIT = 1 << 3 ,
  SHADER_TEXTURE_ALPHA_BIT = 1 << 4 , SHADER_TEXTURE_REPLACE_BIT = 1 << 5 , SHADER_TEXTURE_REPLACE_RGB_BIT = 1 << 6 , SHADER_ALPHA_TEST_BIT = 1 << 7 ,
  SHADER_TEXTURE_DECAL_BIT = 1 << 8 , SHADER_DIFFUSE_MAP_BIT = 1 << 10 , SHADER_DIFFUSE_UVW_BIT = 1 << 11 , SHADER_LIGHT_1_POINT = 1 << 20 ,
  SHADER_LIGHT_2_POINT = 1 << 21 , SHADER_LIGHT_3_POINT = 1 << 22 , SHADER_LIGHT_4_POINT = 1 << 23 , SHADER_LIGHT_5_POINT = 1 << 24 ,
  SHADER_LIGHT_6_POINT = 1 << 25 , SHADER_LIGHT_7_POINT = 1 << 26 , SHADER_LIGHT_8_POINT = 1 << 27 , SHADER_NUM_LIGHTS_FIELD_OFFSET = 28 ,
  SHADER_NUM_LIGHTS_1 = 1 << SHADER_NUM_LIGHTS_FIELD_OFFSET , SHADER_NUM_LIGHTS_2 = 2 << SHADER_NUM_LIGHTS_FIELD_OFFSET , SHADER_NUM_LIGHTS_3 = 3 << SHADER_NUM_LIGHTS_FIELD_OFFSET , SHADER_NUM_LIGHTS_4 = 4 << SHADER_NUM_LIGHTS_FIELD_OFFSET ,
  SHADER_NUM_LIGHTS_5 = 5 << SHADER_NUM_LIGHTS_FIELD_OFFSET , SHADER_NUM_LIGHTS_6 = 6 << SHADER_NUM_LIGHTS_FIELD_OFFSET , SHADER_NUM_LIGHTS_7 = 7 << SHADER_NUM_LIGHTS_FIELD_OFFSET , SHADER_NUM_LIGHTS_8 = 8 << SHADER_NUM_LIGHTS_FIELD_OFFSET
}
 
enum  MaxLikeShaderOptions_e {
  MAXLIKE_SHADER_VERTEX_COLOR_BIT = 1 << 9 , MAXLIKE_SHADER_DIFFUSE_MAP_BIT = 1 << 10 , MAXLIKE_SHADER_DIFFUSE_UVW_BIT = 1 << 11 , MAXLIKE_SHADER_DIFFUSE_AMOUNT_BIT = 1 << 12 ,
  MAXLIKE_SHADER_NORMAL_MAP_BIT = 1 << 13 , MAXLIKE_SHADER_NORMAL_UVW_BIT = 1 << 14 , MAXLIKE_SHADER_NORMAL_AMOUNT_BIT = 1 << 15 , MAXLIKE_SHADER_NORMAL_FLIP_G_BIT = 1 << 16 ,
  MAXLIKE_SHADER_SPECULAR_MAP_BIT = 1 << 17 , MAXLIKE_SHADER_SPECULAR_UVW_BIT = 1 << 18 , MAXLIKE_SHADER_REFLECTION_MAP_BIT = 1 << 19 , MAXLIKE_SHADER_LIGHT_1_POINT = 1 << 20 ,
  MAXLIKE_SHADER_LIGHT_2_POINT = 1 << 21 , MAXLIKE_SHADER_LIGHT_3_POINT = 1 << 22 , MAXLIKE_SHADER_LIGHT_4_POINT = 1 << 23 , MAXLIKE_SHADER_LIGHT_5_POINT = 1 << 24 ,
  MAXLIKE_SHADER_LIGHT_6_POINT = 1 << 25 , MAXLIKE_SHADER_LIGHT_7_POINT = 1 << 26 , MAXLIKE_SHADER_LIGHT_8_POINT = 1 << 27 , MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET = 28 ,
  MAXLIKE_SHADER_NUM_LIGHTS_1 = 1 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET , MAXLIKE_SHADER_NUM_LIGHTS_2 = 2 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET , MAXLIKE_SHADER_NUM_LIGHTS_3 = 3 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET , MAXLIKE_SHADER_NUM_LIGHTS_4 = 4 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET ,
  MAXLIKE_SHADER_NUM_LIGHTS_5 = 5 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET , MAXLIKE_SHADER_NUM_LIGHTS_6 = 6 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET , MAXLIKE_SHADER_NUM_LIGHTS_7 = 7 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET , MAXLIKE_SHADER_NUM_LIGHTS_8 = 8 << MAXLIKE_SHADER_NUM_LIGHTS_FIELD_OFFSET
}
 
typedef unsigned int ShaderBitfieldT
 

Public Member Functions

virtual GlsEffectGetStdEffect (ShaderBitfieldT bitfield)=0
 
virtual GlsEffectGetMaxLikeEffect (ShaderBitfieldT bitfield)=0
 
virtual GlsEffectCreateCustomEffect (const char *vertShader, const char *fragShader)=0
 

Protected Member Functions

 IGlsEffectFactory ()
 
 ~IGlsEffectFactory ()
 

Detailed Description

The interface to a factory for creating GlsEffect objects. Holds the standard and custom shaders, compiles effects, and maintains a list of effects for quick access.

Member Typedef Documentation

◆ ShaderBitfieldT

typedef unsigned int ShaderBitfieldT

type of shader features bitfield

Member Enumeration Documentation

◆ MaxLikeShaderOptions_e

enumeration for bitfield describing max-like shader capability

◆ ShaderOptions_e

enumeration for bitfield describing shader capability

Constructor & Destructor Documentation

◆ IGlsEffectFactory()

IGlsEffectFactory ( )
inlineprotected

empty ctor

◆ ~IGlsEffectFactory()

~IGlsEffectFactory ( )
inlineprotected

empty dtor

Member Function Documentation

◆ CreateCustomEffect()

virtual GlsEffect * CreateCustomEffect ( const char *  vertShader,
const char *  fragShader 
)
pure virtual

Provide custom shaders to create a new effect.

Parameters
[in]vertShaderthe vertex shader source
[in]fragShaderthe fragment shader source
Returns
The effect's ID in the effect factory.

◆ GetMaxLikeEffect()

virtual GlsEffect * GetMaxLikeEffect ( ShaderBitfieldT  bitfield)
pure virtual

Return a max-like effect with the parameters specified.

Parameters
[in]bitfielda bitfield indicating the shader features requested (
See also
MaxLikeShaderOptions_e)
Returns
An effect that meets the requirements of bitfield.

◆ GetStdEffect()

virtual GlsEffect * GetStdEffect ( ShaderBitfieldT  bitfield)
pure virtual

Return a standard effect with the parameters specified. This method is called by the state manager automatically in response to standard draw calls.

Parameters
[in]bitfielda bitfield indicating the shader features requested (
See also
ShaderOptions_e)
Returns
An effect that meets the requirements of bitfield.

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