-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderThread.hpp
43 lines (34 loc) · 889 Bytes
/
RenderThread.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
//
// RenderThread.hpp
// Curvature
//
// Created by Simon Demeule on 2019-03-26.
// Copyright © 2019 Simon Demeule. All rights reserved.
//
#pragma once
#include <thread>
#include <mutex>
#include "RenderCore.hpp"
#include "Tile.hpp"
#include "Camera.hpp"
class RenderScheduler; // forward declare
// class encapsulating a render thread
class RenderThread {
private:
RenderScheduler* renderScheduler;
RenderCore* renderCore;
std::thread thread;
bool done;
int identifier;
public:
RenderThread(RenderScheduler* renderScheduler, RenderCore* renderCore, int identifier);
~RenderThread();
// start the render loop
void start();
// wait for the thread to stop executing
void join();
// the render loop
void renderLoop();
// tile rendering, which makes up the render loop
void renderTile(Tile* tile);
};