dbf-udg

annotate src/sdr.h @ 7:603656331514

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