istereo2

annotate src/sdr.h @ 35:643f4ab609a4

added readme and license
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 31 Oct 2015 05:45:35 +0200
parents 81d35769f546
children
rev   line source
nuclear@2 1 #ifndef SDR_H_
nuclear@2 2 #define SDR_H_
nuclear@2 3
nuclear@2 4 #ifdef __cplusplus
nuclear@2 5 extern "C" {
nuclear@2 6 #endif /* __cplusplus */
nuclear@2 7
nuclear@2 8 /* ---- shaders ---- */
nuclear@2 9 unsigned int create_vertex_shader(const char *src);
nuclear@2 10 unsigned int create_pixel_shader(const char *src);
nuclear@24 11 unsigned int create_tessctl_shader(const char *src);
nuclear@24 12 unsigned int create_tesseval_shader(const char *src);
nuclear@24 13 unsigned int create_geometry_shader(const char *src);
nuclear@2 14 unsigned int create_shader(const char *src, unsigned int sdr_type);
nuclear@2 15 void free_shader(unsigned int sdr);
nuclear@2 16
nuclear@2 17 unsigned int load_vertex_shader(const char *fname);
nuclear@2 18 unsigned int load_pixel_shader(const char *fname);
nuclear@24 19 unsigned int load_tessctl_shader(const char *fname);
nuclear@24 20 unsigned int load_tesseval_shader(const char *fname);
nuclear@24 21 unsigned int load_geometry_shader(const char *fname);
nuclear@2 22 unsigned int load_shader(const char *src, unsigned int sdr_type);
nuclear@2 23
nuclear@2 24 int add_shader(const char *fname, unsigned int sdr);
nuclear@2 25 int remove_shader(const char *fname);
nuclear@2 26
nuclear@2 27 /* ---- gpu programs ---- */
nuclear@2 28 unsigned int create_program(void);
nuclear@24 29 unsigned int create_program_link(unsigned int sdr0, ...);
nuclear@2 30 unsigned int create_program_load(const char *vfile, const char *pfile);
nuclear@2 31 void free_program(unsigned int sdr);
nuclear@2 32
nuclear@2 33 void attach_shader(unsigned int prog, unsigned int sdr);
nuclear@2 34 int link_program(unsigned int prog);
nuclear@2 35 int bind_program(unsigned int prog);
nuclear@2 36
nuclear@2 37 int set_uniform_int(unsigned int prog, const char *name, int val);
nuclear@2 38 int set_uniform_float(unsigned int prog, const char *name, float val);
nuclear@24 39 int set_uniform_float2(unsigned int prog, const char *name, float x, float y);
nuclear@2 40 int set_uniform_float3(unsigned int prog, const char *name, float x, float y, float z);
nuclear@2 41 int set_uniform_float4(unsigned int prog, const char *name, float x, float y, float z, float w);
nuclear@2 42 int set_uniform_matrix4(unsigned int prog, const char *name, float *mat);
nuclear@2 43 int set_uniform_matrix4_transposed(unsigned int prog, const char *name, float *mat);
nuclear@2 44
nuclear@2 45 int get_attrib_loc(unsigned int prog, const char *name);
nuclear@2 46 void set_attrib_float3(int attr_loc, float x, float y, float z);
nuclear@2 47
nuclear@2 48 #ifdef __cplusplus
nuclear@2 49 }
nuclear@2 50 #endif /* __cplusplus */
nuclear@2 51
nuclear@2 52 #endif /* SDR_H_ */