Shader

Types

struct Shader A 32 bit handle.

enum ShaderComparison Comparison functions used for depth and stencil tests.

typedef enum ShaderComparison{
  ShaderComparison_Never = 0,
  ShaderComparison_Less = 1,
  ShaderComparison_Equal = 2,
  ShaderComparison_LEqual = 3 ,
  ShaderComparison_Greater = 4,
  ShaderComparison_NotEqual = 5,
  ShaderComparison_GEqual = 6,
  ShaderComparison_Always = 7
}ShaderComparison;

enum ShaderBlendOp Functions available for compositing.

typedef enum ShaderBlendOp{
  ShaderBlendOp_Add =0,
  ShaderBlendOp_Sub =1,
  ShaderBlendOp_RevSub=2,
  ShaderBlendOp_Min=3,
  ShaderBlendOp_Max=4
}ShaderBlendOp;

enum ShaderCullMode Triangle culling mode. ShaderCullMode_Back culls backfaces.

typedef enum ShaderCullMode{
  ShaderCullMode_None =0,
  ShaderCullMode_Front =1,
  ShaderCullMode_Back=2
}ShaderCullMode;

enum ShaderColorMask Mask for only rendering specific channels. ShaderColorMask_RGBA renders all channels.

typedef enum ShaderColorMask{
  ShaderColorMask_None = 0,
  ShaderColorMask_A = 1,
  ShaderColorMask_B = 2,
  ShaderColorMask_BA = 3,
  ShaderColorMask_G = 4,
  ShaderColorMask_GA = 5,
  ShaderColorMask_GB = 6,
  ShaderColorMask_GBA = 7,
  ShaderColorMask_R = 8,
  ShaderColorMask_RA = 9,
  ShaderColorMask_RB = 10,
  ShaderColorMask_RBA =11,
  ShaderColorMask_RG =12,
  ShaderColorMask_RGA =13,
  ShaderColorMask_RGB =14,
  ShaderColorMask_RGBA=15
}ShaderColorMask;

enum ShaderBlendFactor Fixed Blending weights.

typedef enum ShaderBlendFactor{
  ShaderBlendFactor_Zero = 0,
  ShaderBlendFactor_One = 1,
  ShaderBlendFactor_SrcColor = 2,
  ShaderBlendFactor_OneMinusSrcColor = 3,
  ShaderBlendFactor_SrcAlpha = 4,
  ShaderBlendFactor_OneMinusSrcAlpha = 5,
  ShaderBlendFactor_DstColor = 6,
  ShaderBlendFactor_OneMinusDstColor = 7,
  ShaderBlendFactor_DstAlpha = 8,
  ShaderBlendFactor_OneMinusDstAlpha = 9
}ShaderBlendFactor;

Creation & Destruction

Shader_Create (
const char* vertex_program,
const char* fragment_program,
uint32_t render_queue,
uint32_t texture_count,
bool transparent,
bool write_depth,
bool alpha_to_coverage,
ShaderComparison depth_function,
ShaderCullMode cull_mode,
ShaderColorMask color_mask,
ShaderBlendOp color_blend_op,
ShaderBlendOp alpha_blend_op,
ShaderBlendFactor src_color_factor,
ShaderBlendFactor src_alpha_factor,
ShaderBlendFactor dst_color_factor,
ShaderBlendFactor dst_alpha_factor ) : Shader
Creates a new shader.

Functions

Shader_Exists( Shader shader ) : bool

Shader_RenderQueue( Shader shader ) : uint32_t

Shader_TextureCount( Shader shader ) : uint32_t

Shader_Transparent( Shader shader ) : bool

Shader_WriteDepth( Shader shader ) : bool

Shader_AlphaToCoverage( Shader shader ) : bool

Shader_DepthComparison( Shader shader ) : ShaderComparison

Shader_CullMode( Shader shader ) : ShaderCullMode

Shader_ColorMask( Shader shader ) : ShaderColorMask

Shader_ColorBlendOp( Shader shader ) : ShaderBlendOp

Shader_AlphaBlendOp( Shader shader ) : ShaderBlendOp

Shader_SrcColor( Shader shader ) : ShaderBlendFactor

Shader_SrcAlpha( Shader shader ) : ShaderBlendFactor

Shader_DstColor( Shader shader ) : ShaderBlendFactor

Shader_DstAlpha( Shader shader ) : ShaderBlendFactor