Blame c++/contourgl/glcontext.h

Ivan Mahonin 49e693
/*
Ivan Mahonin 49e693
    ......... 2015 Ivan Mahonin
Ivan Mahonin 49e693
Ivan Mahonin 49e693
    This program is free software: you can redistribute it and/or modify
Ivan Mahonin 49e693
    it under the terms of the GNU General Public License as published by
Ivan Mahonin 49e693
    the Free Software Foundation, either version 3 of the License, or
Ivan Mahonin 49e693
    (at your option) any later version.
Ivan Mahonin 49e693
Ivan Mahonin 49e693
    This program is distributed in the hope that it will be useful,
Ivan Mahonin 49e693
    but WITHOUT ANY WARRANTY; without even the implied warranty of
Ivan Mahonin 49e693
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Ivan Mahonin 49e693
    GNU General Public License for more details.
Ivan Mahonin 49e693
Ivan Mahonin 49e693
    You should have received a copy of the GNU General Public License
Ivan Mahonin 49e693
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
Ivan Mahonin 49e693
*/
Ivan Mahonin 49e693
Ivan Mahonin 49e693
#ifndef _GLCONTEXT_H_
Ivan Mahonin 49e693
#define _GLCONTEXT_H_
Ivan Mahonin 49e693
Ivan Mahonin 49e693
#include <string>
Ivan Mahonin 49e693
Ivan Mahonin 49e693
#include <GL/gl.h>
Ivan Mahonin 49e693
#include <GL/glext.h>
Ivan Mahonin 49e693
#include <GL/glx.h>
Ivan Mahonin 49e693
Ivan Mahonin 49e693
Ivan Mahonin 49e693
class GlContext {
Ivan Mahonin 49e693
public:
Ivan Mahonin 49e693
	Display *display;
Ivan Mahonin 49e693
	GLXPbuffer pbuffer;
Ivan Mahonin 49e693
	GLXContext context;
Ivan Mahonin 49e693
Ivan Mahonin 49e693
	GLuint texture_id;
Ivan Mahonin 49e693
	GLuint framebuffer_id;
Ivan Mahonin 49e693
	GLuint renderbuffer_id;
Ivan Mahonin 49e693
Ivan Mahonin 49e693
	GLuint multisample_texture_id;
Ivan Mahonin 49e693
	GLuint multisample_renderbuffer_id;
Ivan Mahonin 49e693
	GLuint multisample_framebuffer_id;
Ivan Mahonin 49e693
Ivan Mahonin f29469
	GlContext(int width, int height, bool hdr, bool multisample, int samples);
Ivan Mahonin 49e693
	~GlContext();
Ivan Mahonin 49e693
Ivan Mahonin f29469
	void use();
Ivan Mahonin f29469
	void unuse();
Ivan Mahonin f29469
Ivan Mahonin 49e693
	void check(const std::string &s = std::string());
Ivan Mahonin 49e693
};
Ivan Mahonin 49e693
Ivan Mahonin 49e693
#endif