istereo

annotate src/sdr.h @ 43:73813c1176de

better hgignore
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 14 Aug 2015 04:33:42 +0300
parents 1bb950d0976b
children
rev   line source
nuclear@39 1 /*
nuclear@39 2 Stereoscopic tunnel for iOS.
nuclear@39 3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
nuclear@39 4
nuclear@39 5 This program is free software: you can redistribute it and/or modify
nuclear@39 6 it under the terms of the GNU General Public License as published by
nuclear@39 7 the Free Software Foundation, either version 3 of the License, or
nuclear@39 8 (at your option) any later version.
nuclear@39 9
nuclear@39 10 This program is distributed in the hope that it will be useful,
nuclear@39 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@39 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@39 13 GNU General Public License for more details.
nuclear@39 14
nuclear@39 15 You should have received a copy of the GNU General Public License
nuclear@39 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@39 17 */
nuclear@39 18
nuclear@0 19 #ifndef SDR_H_
nuclear@0 20 #define SDR_H_
nuclear@0 21
nuclear@0 22 #ifdef __cplusplus
nuclear@0 23 extern "C" {
nuclear@0 24 #endif /* __cplusplus */
nuclear@0 25
nuclear@0 26 /* ---- shaders ---- */
nuclear@0 27 unsigned int create_vertex_shader(const char *src);
nuclear@0 28 unsigned int create_pixel_shader(const char *src);
nuclear@0 29 unsigned int create_shader(const char *src, unsigned int sdr_type);
nuclear@0 30 void free_shader(unsigned int sdr);
nuclear@0 31
nuclear@0 32 unsigned int load_vertex_shader(const char *fname);
nuclear@0 33 unsigned int load_pixel_shader(const char *fname);
nuclear@0 34 unsigned int load_shader(const char *src, unsigned int sdr_type);
nuclear@0 35
nuclear@0 36 unsigned int get_vertex_shader(const char *fname);
nuclear@0 37 unsigned int get_pixel_shader(const char *fname);
nuclear@0 38 unsigned int get_shader(const char *fname, unsigned int sdr_type);
nuclear@0 39
nuclear@0 40 int add_shader(const char *fname, unsigned int sdr);
nuclear@0 41 int remove_shader(const char *fname);
nuclear@0 42
nuclear@0 43 /* ---- gpu programs ---- */
nuclear@0 44 unsigned int create_program(void);
nuclear@0 45 unsigned int create_program_link(unsigned int vs, unsigned int ps);
nuclear@0 46 unsigned int create_program_load(const char *vfile, const char *pfile);
nuclear@0 47 void free_program(unsigned int sdr);
nuclear@0 48
nuclear@0 49 void attach_shader(unsigned int prog, unsigned int sdr);
nuclear@0 50 int link_program(unsigned int prog);
nuclear@0 51 int bind_program(unsigned int prog);
nuclear@0 52
nuclear@0 53 int set_uniform_int(unsigned int prog, const char *name, int val);
nuclear@0 54 int set_uniform_float(unsigned int prog, const char *name, float val);
nuclear@0 55 int set_uniform_float3(unsigned int prog, const char *name, float x, float y, float z);
nuclear@0 56 int set_uniform_float4(unsigned int prog, const char *name, float x, float y, float z, float w);
nuclear@0 57 int set_uniform_matrix4(unsigned int prog, const char *name, float *mat);
nuclear@0 58 int set_uniform_matrix4_transposed(unsigned int prog, const char *name, float *mat);
nuclear@0 59
nuclear@0 60 int get_attrib_loc(unsigned int prog, const char *name);
nuclear@0 61 void set_attrib_float3(int attr_loc, float x, float y, float z);
nuclear@0 62
nuclear@0 63 #ifdef __cplusplus
nuclear@0 64 }
nuclear@0 65 #endif /* __cplusplus */
nuclear@0 66
nuclear@0 67 #endif /* SDR_H_ */