3 * Copyright (C) 2003-2005, Alexander Zaprjagaev <frustum@frustum.org>
4 * Roman Grigoriev <grigoriev@gosniias.ru>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <simgear/compiler.h>
25 #include <simgear/screen/extensions.hxx>
39 Shader(const char *name,const char *vertex = NULL,const char *fragment = NULL);
42 void bindNames(const char *name,...);
47 void bind(const float *value,...);
49 void setLocalParameter(int location,const float *value);
50 void setEnvParameter(int location,const float *value);
52 void setParameter(const char *name,const float *value);
53 void setParameters(const float *value,...);
55 static void Init(void);
56 inline static bool is_VP_supported(void) {return VP_supported;}
57 inline static bool is_FP_supported(void) {return FP_supported;}
58 inline static bool is_GLSL_supported(void) {return GLSL_supported;}
59 inline static bool is_NVFP_supported(void) {return NVFP_supported;}
60 inline static int get_nb_texture_units(void) {return nb_texture_unit;}
69 const char *get_error(char *data,int pos);
70 const char *get_glsl_error();
72 void getParameter(const char *name,Parameter *parameter);
79 GLuint fragment_target;
82 std::vector<Parameter> parameters;
83 typedef map<string, struct Parameter> arb_parameter_list;
84 arb_parameter_list arb_parameters;
86 static bool VP_supported, FP_supported, GLSL_supported, NVFP_supported;
87 static GLint nb_texture_unit;
90 #endif /* __SHADER_H__ */