4 Copyright 2008-2012 Michel Pollet <buserror@gmail.com>
6 This file is part of libc3.
8 libc3 is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 libc3 is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with libc3. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef __C3PROGRAM_H___
24 #define __C3PROGRAM_H___
29 typedef struct c3shader_t {
30 c3apiobject_t sid; // shader id
34 } c3shader_t, *c3shader_p;
36 DECLARE_C_ARRAY(c3shader_t, c3shader_array, 4);
38 typedef struct c3program_param_t {
39 struct c3program_t * program;
40 c3apiobject_t pid; // parameter id
43 } c3program_param_t, *c3program_param_p;
45 DECLARE_C_ARRAY(c3program_param_t, c3program_param_array, 4);
47 typedef struct c3program_t {
48 c3apiobject_t pid; // program id
51 c3shader_array_t shaders;
52 c3program_param_array_t params;
53 str_p log; // if an error occurs
54 } c3program_t, *c3program_p;
56 DECLARE_C_ARRAY(c3program_p, c3program_array, 4);
58 //! Allocates a new, empty program
63 //! disposes of a c3program memory
68 //! purge deletes the shader storage, but keep the program and parameters
74 C3_PROGRAM_LOAD_UNIFORM = (1 << 0),
78 c3program_load_shader(
82 const char * filename,
86 c3program_locate_param(
90 IMPLEMENT_C_ARRAY(c3program_param_array);
91 IMPLEMENT_C_ARRAY(c3shader_array);
92 IMPLEMENT_C_ARRAY(c3program_array);
94 #endif /* __C3PROGRAM_H___ */