2018-04-07 08:44:39 +00:00
|
|
|
#ifndef MODEL_OFFLINE_RENDER_H
|
|
|
|
#define MODEL_OFFLINE_RENDER_H
|
|
|
|
#include <QOffscreenSurface>
|
|
|
|
#include <QScreen>
|
|
|
|
#include <QOpenGLFunctions>
|
|
|
|
#include <QOpenGLContext>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QThread>
|
2018-08-27 08:50:40 +00:00
|
|
|
#include <QOpenGLWidget>
|
2018-04-07 08:44:39 +00:00
|
|
|
#include "modelshaderprogram.h"
|
|
|
|
#include "modelmeshbinder.h"
|
2018-05-07 17:16:58 +00:00
|
|
|
#include "meshloader.h"
|
2018-04-07 08:44:39 +00:00
|
|
|
|
|
|
|
class ModelOfflineRender : QOffscreenSurface
|
|
|
|
{
|
|
|
|
public:
|
2018-08-27 08:50:40 +00:00
|
|
|
ModelOfflineRender(QOpenGLWidget *sharedContextWidget = nullptr, QScreen *targetScreen = Q_NULLPTR);
|
2018-04-07 08:44:39 +00:00
|
|
|
~ModelOfflineRender();
|
|
|
|
void setRenderThread(QThread *thread);
|
2018-05-07 17:16:58 +00:00
|
|
|
void updateMesh(MeshLoader *mesh);
|
2018-04-07 08:44:39 +00:00
|
|
|
QImage toImage(const QSize &size);
|
2018-09-14 09:45:05 +00:00
|
|
|
void setXRotation(int angle);
|
|
|
|
void setYRotation(int angle);
|
|
|
|
void setZRotation(int angle);
|
2018-04-07 08:44:39 +00:00
|
|
|
private:
|
|
|
|
QOpenGLContext *m_context;
|
2018-05-07 17:16:58 +00:00
|
|
|
MeshLoader *m_mesh;
|
2018-09-14 09:45:05 +00:00
|
|
|
int m_xRot;
|
|
|
|
int m_yRot;
|
|
|
|
int m_zRot;
|
2018-04-07 08:44:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|