Toshihiro Shimizu 890ddd
#ifndef QTOFFLINEGL_H
Toshihiro Shimizu 890ddd
#define QTOFFLINEGL_H
Toshihiro Shimizu 890ddd
Shinya Kitaoka c3fda3
#include <memory></memory>
Shinya Kitaoka c3fda3
Toshihiro Shimizu 890ddd
#include <qtopengl></qtopengl>
Toshihiro Shimizu 890ddd
#include <qglformat></qglformat>
Toshihiro Shimizu 890ddd
#include <qglcontext></qglcontext>
Toshihiro Shimizu 890ddd
#include <qglpixelbuffer></qglpixelbuffer>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tofflinegl.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class QtOfflineGL : public TOfflineGL::Imp
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	QOpenGLContext *m_context;
Toshihiro Shimizu 890ddd
	QOpenGLContext *m_oldContext;
Toshihiro Shimizu 890ddd
	QOffscreenSurface *m_surface;
Toshihiro Shimizu 890ddd
Shinya Kitaoka c3fda3
	QtOfflineGL(TDimension rasterSize, std::shared_ptr<tofflinegl::imp> shared);</tofflinegl::imp>
Toshihiro Shimizu 890ddd
	~QtOfflineGL();
Toshihiro Shimizu 890ddd
Shinya Kitaoka c3fda3
	void createContext(TDimension rasterSize, std::shared_ptr<tofflinegl::imp> shared);</tofflinegl::imp>
Toshihiro Shimizu 890ddd
	void makeCurrent();
Toshihiro Shimizu 890ddd
	void doneCurrent();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void saveCurrentContext();
Toshihiro Shimizu 890ddd
	void restoreCurrentContext();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void getRaster(TRaster32P raster);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class QtOfflineGLPBuffer : public TOfflineGL::Imp
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	QGLPixelBuffer *m_context;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QtOfflineGLPBuffer(TDimension rasterSize);
Toshihiro Shimizu 890ddd
	~QtOfflineGLPBuffer();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void createContext(TDimension rasterSize);
Toshihiro Shimizu 890ddd
	void makeCurrent();
Toshihiro Shimizu 890ddd
	void doneCurrent();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void getRaster(TRaster32P raster);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif