-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
asyncrenderthread.h
42 lines (30 loc) · 957 Bytes
/
asyncrenderthread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef ASYNCRENDERTHREAD_HPP
#define ASYNCRENDERTHREAD_HPP
#include "glew.h"
#include <QGLWidget>
#include <QThread>
class Camera;
class Geometry;
namespace AsyncRenderInternal {
class Controller;
class Job;
//------------------------------------------
//The RenderThread takes jobs from the renderQueue, shoves their Geometry
// through OpenGL, and delivers them back to the RenderController.
//OpenGL stuff based, to some extent, on http://doc.qt.nokia.com/qq/qq06-glimpsing.html#writingmultithreadedglapplications
class RenderThread : public QThread
{
Q_OBJECT
public:
RenderThread(Controller *_controller);
virtual ~RenderThread();
virtual void run();
void setupCamera(Camera const &camera);
void simpleRender(Geometry const &geom);
Controller *controller;
QGLWidget *widget; //kinda silly way of getting a context to work with.
signals:
void jobFinished(Job *job);
};
} //namespace AsyncRenderInteral
#endif //ASYNCRENDERTHREAD_H