bloboland

annotate src/sdr.h @ 3:a39c301cdcce

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