Init (Realtime Shaders)


Description

This callback is fired the first time the shader is instantiated.

Note This callback is mandatory.

Applies To

Custom Realtime Shaders


Syntax

bool <shader_name>_<renderer_name>_Init (
        CRef    in_pCtx, 
        void    **io_pInstanceData
)
{ 
        ... 
}

<shader_name> is the class name registered for this shader, with any spaces converted to underscores. In the case of a shader definition plug-in, the name is specified in the call to PluginRegistrar::RegisterShader. In the case of a shader definition created with a parser, the name is set in the ParseInfo callback via the ClassName attribute.

<renderer_name> is the name of the rendering engine. For example, an OpenGL shader with a class name of Sunset will use Sunset_OpenGL_Init, whereas the version parsed from a .cgfx file will use Sunset_CgFx_Init.


Parameters

Parameter Type Description
in_pCtx CRef& A reference to the HardwareShaderContext object.
io_pInstanceData void A pointer to the shader instance user data

See Also