Newer
Older
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
#pragma once
#include "cgp/cgp.hpp"
#include "environment.hpp"
// This definitions allow to use the structures: mesh, mesh_drawable, etc. without mentionning explicitly cgp::
using cgp::mesh;
using cgp::mesh_drawable;
using cgp::vec3;
using cgp::numarray;
using cgp::timer_basic;
// Variables associated to the GUI (buttons, etc)
struct gui_parameters {
bool display_frame = true;
bool display_wireframe = false;
};
// The structure of the custom scene
struct scene_structure : cgp::scene_inputs_generic {
// ****************************** //
// Elements and shapes of the scene
// ****************************** //
camera_controller_orbit_euler camera_control;
camera_projection_perspective camera_projection;
window_structure window;
mesh_drawable global_frame; // The standard global frame
environment_structure environment; // Standard environment controler
input_devices inputs; // Storage for inputs status (mouse, keyboard, window dimension)
gui_parameters gui; // Standard GUI element storage
// ****************************** //
// Elements and shapes of the scene
// ****************************** //
timer_basic timer;
mesh_drawable terrain;
mesh_drawable water;
mesh_drawable tree;
mesh_drawable cube1;
mesh_drawable cube2;
// ****************************** //
// Functions
// ****************************** //
void initialize(); // Standard initialization to be called before the animation loop
void display_frame(); // The frame display to be called within the animation loop
void display_gui(); // The display of the GUI, also called within the animation loop
void mouse_move_event();
void mouse_click_event();
void keyboard_event();
void idle_frame();
};