-
Notifications
You must be signed in to change notification settings - Fork 1
/
scene.h
67 lines (49 loc) · 1.13 KB
/
scene.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef IRIS_SCENCE_H
#define IRIS_SCENCE_H
#include <iris.h>
#include <glue/basic.h>
#include <glue/window.h>
#include <glue/shader.h>
#include <glue/buffer.h>
#include <glue/arrays.h>
#include <dkl.h>
#include <misc.h>
#include <numeric>
#include <random>
namespace iris {
class rectangle {
public:
void draw(glm::mat4 vp);
void init();
void configure(const iris::rgb &new_color);
void configure(const glue::extent &new_size);
glue::extent bounds() const;
private:
iris::rgb color;
glue::extent size;
//gl
glue::shader vs;
glue::shader fs;
glue::program prg;
glue::buffer bb;
glue::vertex_array va;
};
class checkerboard {
public:
checkerboard(const iris::dkl &colorspace, double c);
void init();
void draw(glm::mat4 vp);
void configure(glue::extent frame, glue::extent box_size);
void reset_timer();
double duration() const;
private:
glue::extent size;
std::random_device rd;
std::mt19937 gen;
std::uniform_int_distribution<size_t> dis;
rectangle box;
std::vector<iris::rgb> colors;
double t_start;
};
}
#endif //IRIS_SCENCE_H