Blame c++/contourgl/shaders.h

Ivan Mahonin 7c6b57
/*
Ivan Mahonin 7c6b57
    ......... 2015 Ivan Mahonin
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
    This program is free software: you can redistribute it and/or modify
Ivan Mahonin 7c6b57
    it under the terms of the GNU General Public License as published by
Ivan Mahonin 7c6b57
    the Free Software Foundation, either version 3 of the License, or
Ivan Mahonin 7c6b57
    (at your option) any later version.
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
    This program is distributed in the hope that it will be useful,
Ivan Mahonin 7c6b57
    but WITHOUT ANY WARRANTY; without even the implied warranty of
Ivan Mahonin 7c6b57
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Ivan Mahonin 7c6b57
    GNU General Public License for more details.
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
    You should have received a copy of the GNU General Public License
Ivan Mahonin 7c6b57
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
Ivan Mahonin 7c6b57
*/
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
#include <GL/gl.h>
Ivan Mahonin 7c6b57
#include <GL/glext.h>
Ivan Mahonin 7c6b57
#include <GL/glx.h>
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
#include "rendersw.h"
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
class Shaders {
Ivan Mahonin 7c6b57
private:
Ivan Mahonin 7c6b57
	GLuint simple_vertex_id;
Ivan Mahonin 7c6b57
	GLuint simpleProgramId;
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
	GLuint color_fragment_id;
Ivan Mahonin 7c6b57
	GLuint colorProgramId;
Ivan Mahonin 7c6b57
	GLint colorUniform;
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
	Shaders();
Ivan Mahonin 7c6b57
	~Shaders();
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
	static Shaders *instance;
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
	void check_shader(GLuint id, const char *src);
Ivan Mahonin 7c6b57
	void check_program(GLuint id, const char *name);
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
public:
Ivan Mahonin 7c6b57
	static void initialize();
Ivan Mahonin 7c6b57
	static void deinitialize();
Ivan Mahonin 7c6b57
Ivan Mahonin 7c6b57
	static void simple();
Ivan Mahonin 7c6b57
	static void color(const Color &c);
Ivan Mahonin 7c6b57
};