X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=blobdiff_plain;f=src%2Fsdr.h;h=7bf23893c27113a7128cd08dee24e507e28ef2f9;hp=df23bcd09dc03642303f77aa2a78afe233101397;hb=7c59a70219aa7bcf80291f41903a9e6fc9b6e073;hpb=dd39621d642e417f1e343cbf813205a658272639 diff --git a/src/sdr.h b/src/sdr.h index df23bcd..7bf2389 100644 --- a/src/sdr.h +++ b/src/sdr.h @@ -34,17 +34,33 @@ void attach_shader(unsigned int prog, unsigned int sdr); int link_program(unsigned int prog); int bind_program(unsigned int prog); +int get_uniform_loc(unsigned int prog, const char *name); + int set_uniform_int(unsigned int prog, const char *name, int val); int set_uniform_float(unsigned int prog, const char *name, float val); int set_uniform_float2(unsigned int prog, const char *name, float x, float y); int set_uniform_float3(unsigned int prog, const char *name, float x, float y, float z); int set_uniform_float4(unsigned int prog, const char *name, float x, float y, float z, float w); -int set_uniform_matrix4(unsigned int prog, const char *name, float *mat); -int set_uniform_matrix4_transposed(unsigned int prog, const char *name, float *mat); +int set_uniform_matrix4(unsigned int prog, const char *name, const float *mat); +int set_uniform_matrix4_transposed(unsigned int prog, const char *name, const float *mat); int get_attrib_loc(unsigned int prog, const char *name); void set_attrib_float3(int attr_loc, float x, float y, float z); +/* ---- shader composition ---- */ + +/* clear shader header/footer text. + * pass the shader type to clear, or 0 to clear all types */ +void clear_shader_header(unsigned int type); +void clear_shader_footer(unsigned int type); +/* append text to the header/footer of a specific shader type + * or use type 0 to add it to all shade types */ +void add_shader_header(unsigned int type, const char *s); +void add_shader_footer(unsigned int type, const char *s); +/* get the current header/footer text for a specific shader type */ +const char *get_shader_header(unsigned int type); +const char *get_shader_footer(unsigned int type); + #ifdef __cplusplus } #endif /* __cplusplus */