tavli

annotate src/sdr.h @ 24:0aadb519b5ee

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