Function Index Class Index

Driver_XXX_Shader_XXXX


Functions

HC_EXTERNAL HIC_API
HC_POINTER_SIZED_INT 
HIC_Driver_Compile_Shader (HIC_Rendition const *nr, HIC_Shader_Type type, char const *shader_source)
HC_EXTERNAL HIC_API void HIC_Driver_Draw_Clear_Window (HIC_Rendition const *nr, HIC_Int_Rectangle const *extent)
HC_EXTERNAL HIC_API void HIC_Driver_Release_Shader (HIC_Rendition const *nr, HC_POINTER_SIZED_INT shader_handle)
HC_EXTERNAL HIC_API bool HIC_Driver_Set_Shader (HIC_Rendition const *nr, HIC_Shader_Type type, HC_POINTER_SIZED_INT shader_handle)
HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Float (HIC_Rendition const *nr, HIC_Shader_Type type, char const *name, int count, float const *data)
HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Integer (HIC_Rendition const *nr, HIC_Shader_Type type, char const *name, int count, int const *data)
HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Matrix (HIC_Rendition const *nr, HIC_Shader_Type type, char const *name, int count, float const *data)
HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Vector (HIC_Rendition const *nr, HIC_Shader_Type type, char const *name, int width, int count, float const *data)
HC_EXTERNAL HIC_API void HIC_Driver_Show_Projection_Matrix (HIC_Rendition const *nr, float *matrix)
HC_EXTERNAL HIC_API void HIC_Driver_Show_Shader_Modelview_Matrix (HIC_Rendition const *nr, float *matrix)
HC_EXTERNAL HIC_API void HIC_Driver_Show_Shader_Projection_Matrix (HIC_Rendition const *nr, float *matrix)
HC_EXTERNAL HIC_API
HC_POINTER_SIZED_INT 
HIC_Driver_Snapshot_Depth_Texture (HIC_Rendition const *nr, HC_POINTER_SIZED_INT id)
HC_EXTERNAL HIC_API
HC_POINTER_SIZED_INT 
HIC_Driver_Snapshot_Texture (HIC_Rendition const *nr, HC_POINTER_SIZED_INT id)

Function Documentation

HC_EXTERNAL HIC_API HC_POINTER_SIZED_INT HIC_Driver_Compile_Shader ( HIC_Rendition const *  nr,
HIC_Shader_Type  type,
char const *  shader_source 
)

Compiles the supplied shader source, and returns a handle to the resulting shader. The type indicates whether it is avertex or pixel shader, and shader_source points to a character buffer containing the shader's source code.

Notes:

  • for DX9, the vertex shader's main function must be called "vs_main", and the pixel shader's main function "ps_main".
  • for OGL2, the main function of each shader should be just "main".

Parameters:
nr A pointer to a const HIC_Rendition.
type A HIC_Shader_Type enum.
shader_source A pointer to a const char containing the shader source code.
Returns:
A HC_POINTER_SIZED_INT, a shader handle.

HC_EXTERNAL HIC_API void HIC_Driver_Draw_Clear_Window ( HIC_Rendition const *  nr,
HIC_Int_Rectangle const *  extent 
)

HC_EXTERNAL HIC_API void HIC_Driver_Release_Shader ( HIC_Rendition const *  nr,
HC_POINTER_SIZED_INT  shader_handle 
)

Deactivates a shader from the driver.

Parameters:
nr A pointer to a const HIC_Rendition.
shader_handle A HC_POINTER_SIZED_INT, a shader handle.
The behavior of this function is driver and platform specific.

HC_EXTERNAL HIC_API bool HIC_Driver_Set_Shader ( HIC_Rendition const *  nr,
HIC_Shader_Type  type,
HC_POINTER_SIZED_INT  shader_handle 
)

Sets a shader to be active. The return value is true if the user needs to re-set constant uniforms due to shader switching.

Notes: Both a user pixel and vertex shader must be set each time the callback is called for the user shaders to be active.

Parameters:
nr A pointer to a const HIC_Rendition.
type A HIC_Shader_Type enum.
shader_handle A HC_POINTER_SIZED_INT, a shader handle.
Returns:
A bool, true if the shader was newly set.

HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Float ( HIC_Rendition const *  nr,
HIC_Shader_Type  type,
char const *  name,
int  count,
float const *  data 
)

Sets a shader float uniform. The name is the uniform name, count is how many floats to set, and data is a pointer to the data.

Parameters:
nr A pointer to a const HIC_Rendition.
type A HIC_Shader_Type enum.
name A char const pointer to a shader uniform name.
count An int indicating the number of floats to set.
data A float pointer to the data to set on the shader.
The behavior of this function is driver and platform specific.

HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Integer ( HIC_Rendition const *  nr,
HIC_Shader_Type  type,
char const *  name,
int  count,
int const *  data 
)

Sets a shader integer uniform. The name is the uniform name, count is how many integers to set, and data is a pointer to the data.

Parameters:
nr A pointer to a const HIC_Rendition.
type A HIC_Shader_Type enum.
name A char const pointer to a shader uniform name.
count An int indicating the number of ints to set.
data An int pointer to the data to set on the shader.

HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Matrix ( HIC_Rendition const *  nr,
HIC_Shader_Type  type,
char const *  name,
int  count,
float const *  data 
)

Sets a shader float matrix uniform. The name is the uniform name, count is how many matrices to set, and data is a pointer to the data.

Parameters:
nr A pointer to a const HIC_Rendition.
type A HIC_Shader_Type enum.
name A char const pointer to a shader uniform name.
count An int indicating the number of matrices to set.
data A float pointer to the data to set on the shader.

HC_EXTERNAL HIC_API void HIC_Driver_Set_Shader_Vector ( HIC_Rendition const *  nr,
HIC_Shader_Type  type,
char const *  name,
int  width,
int  count,
float const *  data 
)

Sets a shader float vector uniform. The name is the uniform name, width is the width of each vector, count is how many vectors to set, and data is a pointer to the data.

Parameters:
nr A pointer to a const HIC_Rendition.
type A HIC_Shader_Type enum.
name A char const pointer to a shader uniform name.
width An int specifying the width of the vector.
count An int indicating the number of vectors to set.
data A float pointer to the data to set on the shader.

HC_EXTERNAL HIC_API void HIC_Driver_Show_Projection_Matrix ( HIC_Rendition const *  nr,
float *  matrix 
)

HC_EXTERNAL HIC_API void HIC_Driver_Show_Shader_Modelview_Matrix ( HIC_Rendition const *  nr,
float *  matrix 
)

Retrieves the modelview matrix that HOOPS would have set on the shader, and writes it into matrix (a float[16] buffer).

Parameters:
nr A pointer to a const HIC_Rendition.
type A pointer to a float array to store the return matrix.

HC_EXTERNAL HIC_API void HIC_Driver_Show_Shader_Projection_Matrix ( HIC_Rendition const *  nr,
float *  matrix 
)

Retrieves the projection matrix that HOOPS would have set on the shader, and writes it into matrix (a float[16] buffer).

Parameters:
nr A pointer to a const HIC_Rendition.
type A pointer to a float array to store the return matrix.

HC_EXTERNAL HIC_API HC_POINTER_SIZED_INT HIC_Driver_Snapshot_Depth_Texture ( HIC_Rendition const *  nr,
HC_POINTER_SIZED_INT  id 
)

HC_EXTERNAL HIC_API HC_POINTER_SIZED_INT HIC_Driver_Snapshot_Texture ( HIC_Rendition const *  nr,
HC_POINTER_SIZED_INT  id 
)