Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
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>
tomosu 794bf5
#include <qopenglframebufferobject></qopenglframebufferobject>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tofflinegl.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class QtOfflineGL : public TOfflineGL::Imp {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  std::shared_ptr<qopenglcontext> m_context;</qopenglcontext>
Shinya Kitaoka 120a6e
  std::shared_ptr<qopenglcontext> m_oldContext;</qopenglcontext>
Shinya Kitaoka 120a6e
  std::shared_ptr<qoffscreensurface> m_surface;</qoffscreensurface>
Shinya Kitaoka 120a6e
  std::shared_ptr<qopenglframebufferobject> m_fbo;</qopenglframebufferobject>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QtOfflineGL(TDimension rasterSize, std::shared_ptr<tofflinegl::imp> shared);</tofflinegl::imp>
Shinya Kitaoka 120a6e
  ~QtOfflineGL();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void createContext(TDimension rasterSize,
Shinya Kitaoka 473e70
                     std::shared_ptr<tofflinegl::imp> shared) override;</tofflinegl::imp>
Shinya Kitaoka 473e70
  void makeCurrent() override;
Shinya Kitaoka 473e70
  void doneCurrent() override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void saveCurrentContext();
Shinya Kitaoka 120a6e
  void restoreCurrentContext();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void getRaster(TRaster32P raster) override;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class QtOfflineGLPBuffer : public TOfflineGL::Imp {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  std::shared_ptr<qglpixelbuffer> m_context;</qglpixelbuffer>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QtOfflineGLPBuffer(TDimension rasterSize);
Shinya Kitaoka 120a6e
  ~QtOfflineGLPBuffer();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void createContext(TDimension rasterSize);
Shinya Kitaoka 473e70
  void makeCurrent() override;
Shinya Kitaoka 473e70
  void doneCurrent() override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void getRaster(TRaster32P raster) override;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif