view src/sdr.h @ 39:ff055bff6a15

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