nuclear@39: /* nuclear@39: Stereoscopic tunnel for iOS. nuclear@39: Copyright (C) 2011 John Tsiombikas nuclear@39: nuclear@39: This program is free software: you can redistribute it and/or modify nuclear@39: it under the terms of the GNU General Public License as published by nuclear@39: the Free Software Foundation, either version 3 of the License, or nuclear@39: (at your option) any later version. nuclear@39: nuclear@39: This program is distributed in the hope that it will be useful, nuclear@39: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@39: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@39: GNU General Public License for more details. nuclear@39: nuclear@39: You should have received a copy of the GNU General Public License nuclear@39: along with this program. If not, see . nuclear@39: */ nuclear@39: nuclear@0: #ifndef SDR_H_ nuclear@0: #define SDR_H_ nuclear@0: nuclear@0: #ifdef __cplusplus nuclear@0: extern "C" { nuclear@0: #endif /* __cplusplus */ nuclear@0: nuclear@0: /* ---- shaders ---- */ nuclear@0: unsigned int create_vertex_shader(const char *src); nuclear@0: unsigned int create_pixel_shader(const char *src); nuclear@0: unsigned int create_shader(const char *src, unsigned int sdr_type); nuclear@0: void free_shader(unsigned int sdr); nuclear@0: nuclear@0: unsigned int load_vertex_shader(const char *fname); nuclear@0: unsigned int load_pixel_shader(const char *fname); nuclear@0: unsigned int load_shader(const char *src, unsigned int sdr_type); nuclear@0: nuclear@0: unsigned int get_vertex_shader(const char *fname); nuclear@0: unsigned int get_pixel_shader(const char *fname); nuclear@0: unsigned int get_shader(const char *fname, unsigned int sdr_type); nuclear@0: nuclear@0: int add_shader(const char *fname, unsigned int sdr); nuclear@0: int remove_shader(const char *fname); nuclear@0: nuclear@0: /* ---- gpu programs ---- */ nuclear@0: unsigned int create_program(void); nuclear@0: unsigned int create_program_link(unsigned int vs, unsigned int ps); nuclear@0: unsigned int create_program_load(const char *vfile, const char *pfile); nuclear@0: void free_program(unsigned int sdr); nuclear@0: nuclear@0: void attach_shader(unsigned int prog, unsigned int sdr); nuclear@0: int link_program(unsigned int prog); nuclear@0: int bind_program(unsigned int prog); nuclear@0: nuclear@0: int set_uniform_int(unsigned int prog, const char *name, int val); nuclear@0: int set_uniform_float(unsigned int prog, const char *name, float val); nuclear@0: int set_uniform_float3(unsigned int prog, const char *name, float x, float y, float z); nuclear@0: int set_uniform_float4(unsigned int prog, const char *name, float x, float y, float z, float w); nuclear@0: int set_uniform_matrix4(unsigned int prog, const char *name, float *mat); nuclear@0: int set_uniform_matrix4_transposed(unsigned int prog, const char *name, float *mat); nuclear@0: nuclear@0: int get_attrib_loc(unsigned int prog, const char *name); nuclear@0: void set_attrib_float3(int attr_loc, float x, float y, float z); nuclear@0: nuclear@0: #ifdef __cplusplus nuclear@0: } nuclear@0: #endif /* __cplusplus */ nuclear@0: nuclear@0: #endif /* SDR_H_ */