nuclear@3: #ifndef SDR_H_ nuclear@3: #define SDR_H_ nuclear@3: nuclear@3: #ifdef __cplusplus nuclear@3: extern "C" { nuclear@3: #endif /* __cplusplus */ nuclear@3: nuclear@3: /* ---- shaders ---- */ nuclear@3: unsigned int create_vertex_shader(const char *src); nuclear@3: unsigned int create_pixel_shader(const char *src); nuclear@3: unsigned int create_tessctl_shader(const char *src); nuclear@3: unsigned int create_tesseval_shader(const char *src); nuclear@3: unsigned int create_geometry_shader(const char *src); nuclear@3: unsigned int create_shader(const char *src, unsigned int sdr_type); nuclear@3: void free_shader(unsigned int sdr); nuclear@3: nuclear@3: unsigned int load_vertex_shader(const char *fname); nuclear@3: unsigned int load_pixel_shader(const char *fname); nuclear@3: unsigned int load_tessctl_shader(const char *fname); nuclear@3: unsigned int load_tesseval_shader(const char *fname); nuclear@3: unsigned int load_geometry_shader(const char *fname); nuclear@3: unsigned int load_shader(const char *src, unsigned int sdr_type); nuclear@3: nuclear@3: unsigned int get_vertex_shader(const char *fname); nuclear@3: unsigned int get_pixel_shader(const char *fname); nuclear@3: unsigned int get_tessctl_shader(const char *fname); nuclear@3: unsigned int get_tesseval_shader(const char *fname); nuclear@3: unsigned int get_geometry_shader(const char *fname); nuclear@3: unsigned int get_shader(const char *fname, unsigned int sdr_type); nuclear@3: nuclear@3: int add_shader(const char *fname, unsigned int sdr); nuclear@3: int remove_shader(const char *fname); nuclear@3: nuclear@3: /* ---- gpu programs ---- */ nuclear@3: unsigned int create_program(void); nuclear@3: unsigned int create_program_link(unsigned int sdr0, ...); nuclear@3: unsigned int create_program_load(const char *vfile, const char *pfile); nuclear@3: void free_program(unsigned int sdr); nuclear@3: nuclear@3: void attach_shader(unsigned int prog, unsigned int sdr); nuclear@3: int link_program(unsigned int prog); nuclear@3: int bind_program(unsigned int prog); nuclear@3: nuclear@3: int set_uniform_int(unsigned int prog, const char *name, int val); nuclear@3: int set_uniform_float(unsigned int prog, const char *name, float val); nuclear@3: int set_uniform_float2(unsigned int prog, const char *name, float x, float y); nuclear@3: int set_uniform_float3(unsigned int prog, const char *name, float x, float y, float z); nuclear@3: int set_uniform_float4(unsigned int prog, const char *name, float x, float y, float z, float w); nuclear@3: int set_uniform_matrix4(unsigned int prog, const char *name, float *mat); nuclear@3: int set_uniform_matrix4_transposed(unsigned int prog, const char *name, float *mat); nuclear@3: nuclear@3: int get_attrib_loc(unsigned int prog, const char *name); nuclear@3: void set_attrib_float3(int attr_loc, float x, float y, float z); nuclear@3: nuclear@3: #ifdef __cplusplus nuclear@3: } nuclear@3: #endif /* __cplusplus */ nuclear@3: nuclear@3: #endif /* SDR_H_ */