istereo2

annotate src/sdr.h @ 2:81d35769f546

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