move gl rendering to another thread

This commit is contained in:
itsmattkc
2019-01-15 17:48:36 +11:00
parent f3b0a3355c
commit 658a6d379e
15 changed files with 872 additions and 585 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef RENDERTHREAD_H
#define RENDERTHREAD_H
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <QOffscreenSurface>
#include <QOpenGLContext>
#include <QOpenGLFramebufferObject>
struct Sequence;
class RenderThread : public QThread {
public:
RenderThread();
~RenderThread();
void run();
QMutex mutex;
GLuint frameBuffer;
GLuint texColorBuffer;
void paint();
void start_render(QOpenGLContext* share, Sequence* s);
private:
QWaitCondition waitCond;
QOffscreenSurface surface;
QOpenGLContext* share_ctx;
QOpenGLContext* ctx;
Sequence* seq;
};
#endif // RENDERTHREAD_H