-
Notifications
You must be signed in to change notification settings - Fork 8
/
Runner.hpp
37 lines (35 loc) · 965 Bytes
/
Runner.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
#include <stdio.h>
#include <spdlog/spdlog.h>
#include "FT60XBusConnector.hpp"
#include "RRXGL.hpp"
#include "gl.h"
#include "glu.h"
#include "ThreadedRenderer.hpp"
template <typename Scene>
class Runner
{
public:
Runner()
{
spdlog::set_level(spdlog::level::trace);
rr::RRXGL::createInstance(m_busConnector);
rr::RRXGL::getInstance().setRenderResolution(RESOLUTION_W, RESOLUTION_H);
m_threadedRenderer.setRenderer(&(rr::RRXGL::getInstance()));
}
void execute()
{
m_scene.init(RESOLUTION_W, RESOLUTION_H);
while (1)
{
m_scene.draw();
m_threadedRenderer.waitForThread();
m_threadedRenderer.render();
}
}
private:
static constexpr uint32_t RESOLUTION_H = 600;
static constexpr uint32_t RESOLUTION_W = 1024;
rr::FT60XBusConnector m_busConnector;
rr::ThreadedRenderer<rr::RRXGL> m_threadedRenderer {};
Scene m_scene {};
};