stereoplay

view src/sdr.h @ 4:acf3d25f23cb

added license headings
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 03 Nov 2011 21:57:12 +0200
parents 265a24704ff2
children
line source
1 /*
2 Stereoplay - an OpenGL stereoscopic video player.
3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
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
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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 <http://www.gnu.org/licenses/>.
17 */
19 #ifndef _SDR_H_
20 #define _SDR_H_
22 /* ---- shaders ---- */
23 unsigned int create_vertex_shader(const char *src);
24 unsigned int create_pixel_shader(const char *src);
25 unsigned int create_shader(const char *src, unsigned int sdr_type);
26 void free_shader(unsigned int sdr);
28 unsigned int load_vertex_shader(const char *fname);
29 unsigned int load_pixel_shader(const char *fname);
30 unsigned int load_shader(const char *src, unsigned int sdr_type);
32 unsigned int get_vertex_shader(const char *fname);
33 unsigned int get_pixel_shader(const char *fname);
34 unsigned int get_shader(const char *fname, unsigned int sdr_type);
36 int add_shader(const char *fname, unsigned int sdr);
37 int remove_shader(const char *fname);
39 /* ---- gpu programs ---- */
40 unsigned int create_program(void);
41 unsigned int create_program_link(unsigned int vs, unsigned int ps);
42 unsigned int create_program_load(const char *vfile, const char *pfile);
43 void free_program(unsigned int sdr);
45 void attach_shader(unsigned int prog, unsigned int sdr);
46 int link_program(unsigned int prog);
47 int bind_program(unsigned int prog);
49 int set_uniform_int(unsigned int prog, const char *name, int val);
50 int set_uniform_float(unsigned int prog, const char *name, float val);
52 #endif /* _SDR_H_ */