-
Notifications
You must be signed in to change notification settings - Fork 0
/
Renderer.hpp
45 lines (34 loc) · 916 Bytes
/
Renderer.hpp
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
43
44
45
#ifndef RENDERER_HPP
#define RENDERER_HPP
#include <vector>
#include <QWindow>
#include <QElapsedTimer>
#include <QOpenGLShaderProgram>
#include <QOpenGLContext>
#include <mutex>
#include <condition_variable>
class OpenGLWidget;
#include "Playground.hpp"
class Renderer : public QObject
{
Q_OBJECT
public:
explicit Renderer(OpenGLWidget *window,
std::condition_variable *job_ready,
std::mutex *mtx,
Swapper *swpr);
~Renderer();
bool createContext();
void start();
void run();
// void render(RenderJob *job);
private:
QOpenGLContext *threadContext;
OpenGLWidget *surfaceWindow;
std::condition_variable *job_ready;
std::mutex *mtx;
Swapper *swapper;
QHash<uint32_t, GLuint> vaoStore;
QOpenGLShaderProgram *program;
};
#endif // RENDERER_HPP