| GL Studio C++ Runtime API

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
GlsRenderEffect Class Referenceabstract

`#include <gls_render_effect.h>`

Inheritance diagram for GlsRenderEffect:

## Classes
class | TextureSettings

## Public Types
typedef bool(* | DebugModeChangeCallback) (void *user, const char *modeName, bool value)
Public Types inherited from VertexAttribIndexLookup
enum | AttributeSemanticEnum { ATTRIB_UNDEFINED = 0 , ATTRIB_POSITION = 0x80000000 , ATTRIB_NORMAL , ATTRIB_BLENDWEIGHT , ATTRIB_TANGENT , ATTRIB_BINORMAL , ATTRIB_BLENDINDICES , ATTRIB_PSIZE , ATTRIB_TEXCOORD0 , ATTRIB_TEXCOORD1 , ATTRIB_TEXCOORD2 , ATTRIB_TEXCOORD3 , ATTRIB_TEXCOORD4 , ATTRIB_TEXCOORD5 , ATTRIB_TEXCOORD6 , ATTRIB_TEXCOORD7 }

## Public Member Functions
virtual void | AddRef ()=0
| Add to this object's reference count. More...
virtual void | Release ()=0
| Release a reference to this object. More...
virtual unsigned int | GlsRenderEffect_ClassID () const =0
virtual void | SetupEffect (DynamicArray< Material > &materialPalette, TexturePalette *texturePalette, const TextureSettings &textureSettings, float *viewToWorld3x3, unsigned int maxLightNum, unsigned int activeLightMask)=0
virtual int | Compare (const GlsRenderEffect *other) const =0
bool | Equals (const GlsRenderEffect *other) const
virtual DistiAttribDict & | Attributes ()=0
virtual const std::string & | EffectTypeName ()=0
virtual GlsRenderEffect * | Clone () const =0
virtual void | GetReferencedMaterials (ReferencedMaterialArray &referencedMaterials)
virtual void | GetReferencedTextures (ReferencedTextureArray &referencedTextures)
Public Member Functions inherited from VertexAttribIndexLookup
virtual GLint | GetVertexAttribIndexForSemantic (int semanticEnum)=0

## Static Public Member Functions
static unsigned int | SetDebugMode (const char *modeName, bool value)
static unsigned int | RegisterNewClassID (const char *debugStr=NULL)
static bool | RegisterDebugModeChangeCallback (void *param, DebugModeChangeCallback func)
static bool | UnregisterDebugModeChangeCallback (void *param, DebugModeChangeCallback func)

## Detailed Description

Abstract render effect class Encapsulates an effect that can be applied to the OpenGL state to modify the appearance of geometry. This API currently only supports single pass techniques.

## Member Typedef Documentation

## ◆ DebugModeChangeCallback

typedef bool(* DebugModeChangeCallback) (void *user, const char *modeName, bool value)

Typedef for DebugMode change callbacks.

See also
  RegisterDebugModeChangeCallback

Parameters

  user | Pointer that was provided when the callback was registered.
  modeName | Name of the mode that is changing.
  value | True to enable the mode, false to disable.
  returns | True if the callback recognized the mode change, false otherwise.

## Member Function Documentation

## ◆ AddRef()

virtual void AddRef | ( |  | ) |
| pure virtual

Add to this object's reference count.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ Attributes()

virtual DistiAttribDict & Attributes | ( |  | ) |
| pure virtual

Returns
  A reference to the attribute dictionary for this object.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ Clone()

virtual GlsRenderEffect * Clone | ( |  | ) | const
| pure virtual

Returns
  A new instance of the effect with the same settings as this one.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ Compare()

virtual int Compare | ( | const GlsRenderEffect * | other | ) | const
| pure virtual

Returns
  0 if the effects are equal, a positive number if this effect should sort after the other effect, or a negative number if this effect should sort before the other effect. The rendering system uses this to sort effects.

Parameters

  other | The effect to compare with.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ EffectTypeName()

virtual const std::string & EffectTypeName | ( |  | ) |
| pure virtual

Returns
  The human readable type name associated with this effect.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ Equals()

bool Equals | ( | const GlsRenderEffect * | other | ) | const
| inline

Determine if two GlsRenderEffect instances are equivalent The rendering system uses this to eliminate redundant effects.

Parameters

  other | The effect to compare with.

Returns
  True if the compared effects are equivalent.

## ◆ GetReferencedMaterials()

virtual void GetReferencedMaterials | ( | ReferencedMaterialArray & | referencedMaterials | ) |
| inline virtual

Checks whether or not the effect is transparent. Implementing is optional Inserts all referenced textures into the array passed in. Implementing is optional.

Parameters

  referencedMaterials | A returned array of material indices.

Reimplemented in Effect_DiffNormSpecRefl.

## ◆ GetReferencedTextures()

virtual void GetReferencedTextures | ( | ReferencedTextureArray & | referencedTextures | ) |
| inline virtual

Inserts all referenced textures into the array passed in. Implementing is optional.

Parameters

  referencedTextures | A returned array of texture indices.

Reimplemented in Effect_DiffNormSpecRefl.

## ◆ GlsRenderEffect_ClassID()

virtual unsigned int GlsRenderEffect_ClassID | ( |  | ) | const
| pure virtual

Allows for static casting in compare functions

See also
  RegisterNewClassID

Returns
  A unique identifier associated with this effect type.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ RegisterDebugModeChangeCallback()

static bool RegisterDebugModeChangeCallback | ( | void * | param,
|  | DebugModeChangeCallback | func
| ) |  |
| static

Register for debug mode change notifications.

Note
  Be sure to also Unregister!

See also
  UnregisterDebugModeChangeCallback

Parameters

  param | User pointer that will be passed to the callback.
  func | Pointer to the callback function.

Returns
  True on success.

## ◆ RegisterNewClassID()

static unsigned int RegisterNewClassID | ( | const char * | debugStr = `NULL` | ) |
| static

Returns
  A new ClassID. Typically only called once by each GlsRenderEffect implementation.

Parameters

  debugStr | Unused, kept for backward compatibility.

## ◆ Release()

virtual void Release | ( |  | ) |
| pure virtual

Release a reference to this object.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ SetDebugMode()

static unsigned int SetDebugMode | ( | const char * | modeName,
|  | bool | value
| ) |  |
| static

Enable / Disable a debug mode for all effects that support it.

Parameters

  modeName | Name of the mode to enable / disable.
  value | True to enable the mode, false to disable.

Returns
  The number of effect callbacks that recognized the mode change.

## ◆ SetupEffect()

virtual void SetupEffect | ( | DynamicArray< Material > & | materialPalette,
|  | TexturePalette * | texturePalette,
|  | const TextureSettings & | textureSettings,
|  | float * | viewToWorld3x3,
|  | unsigned int | maxLightNum,
|  | unsigned int | activeLightMask
| ) |  |
| pure virtual

Apply the effect to the OpenGL state

Parameters

  materialPalette | Used to access material settings
  texturePalette | Used to access texture maps
  textureSettings | The object-level texture settings
  viewToWorld3x3 | A 3x3 matrix containing the current viewToWorld transfrom. Used for environment mapping effects.
  maxLightNum | The number of active lights in the scene. Used to speed up light calculations.
  activeLightMask | A bit mask of which lights are active in the scene (Ex. GL_LIGHT0, GL_LIGHT2, GL_LIGHT3 and GL_LIGHT7 are active: activeLightMask = ...10001101 last 8 bits in binary = 141u)

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

## ◆ UnregisterDebugModeChangeCallback()

static bool UnregisterDebugModeChangeCallback | ( | void * | param,
|  | DebugModeChangeCallback | func
| ) |  |
| static

Unregister for debug mode change notifications. The parameters must match those that were passed when the callback was registered.

See also
  RegisterDebugModeChangeCallback

Parameters

  param | User pointer that was passed to RegisterDebugModeChangeCallback.
  func | Function pointer that was passed to RegisterDebugModeChangeCallback.

Returns
  True if the callback was found and unregistered.

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

- gls_render_effect.h