qvolray
view src/sdr.h @ 8:ae10631bb11b
cleaning up a bit to expand
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 07 Apr 2012 16:07:12 +0300 |
parents | |
children |
line source
1 #ifndef SDR_H_
2 #define SDR_H_
4 #ifdef __cplusplus
5 extern "C" {
6 #endif /* __cplusplus */
8 /* ---- shaders ---- */
9 unsigned int create_vertex_shader(const char *src);
10 unsigned int create_pixel_shader(const char *src);
11 unsigned int create_shader(const char *src, unsigned int sdr_type);
12 void free_shader(unsigned int sdr);
14 unsigned int load_vertex_shader(const char *fname);
15 unsigned int load_pixel_shader(const char *fname);
16 unsigned int load_shader(const char *src, unsigned int sdr_type);
18 unsigned int get_vertex_shader(const char *fname);
19 unsigned int get_pixel_shader(const char *fname);
20 unsigned int get_shader(const char *fname, unsigned int sdr_type);
22 int add_shader(const char *fname, unsigned int sdr);
23 int remove_shader(const char *fname);
25 /* ---- gpu programs ---- */
26 unsigned int create_program(void);
27 unsigned int create_program_link(unsigned int vs, unsigned int ps);
28 unsigned int create_program_load(const char *vfile, const char *pfile);
29 void free_program(unsigned int sdr);
31 void attach_shader(unsigned int prog, unsigned int sdr);
32 int link_program(unsigned int prog);
33 int bind_program(unsigned int prog);
35 int set_uniform_int(unsigned int prog, const char *name, int val);
36 int set_uniform_float(unsigned int prog, const char *name, float val);
37 int set_uniform_float3(unsigned int prog, const char *name, float x, float y, float z);
38 int set_uniform_float4(unsigned int prog, const char *name, float x, float y, float z, float w);
39 int set_uniform_matrix4(unsigned int prog, const char *name, float *mat);
40 int set_uniform_matrix4_transposed(unsigned int prog, const char *name, float *mat);
42 int get_attrib_loc(unsigned int prog, const char *name);
43 void set_attrib_float3(int attr_loc, float x, float y, float z);
45 #ifdef __cplusplus
46 }
47 #endif /* __cplusplus */
49 #endif /* SDR_H_ */