OGLplus
(0.59.0)
a C++ wrapper for rendering APIs
example
application
024_overdraw
main.hpp
1
9
#ifndef OGLPLUS_EXAMPLE_MAIN_HPP // NOLINT(llvm-header-guard)
10
#define OGLPLUS_EXAMPLE_MAIN_HPP
11
12
#include "resources.hpp"
13
14
#include <
eagine/application/camera.hpp
>
15
#include <
eagine/application/interface.hpp
>
16
#include <
eagine/cleanup_group.hpp
>
17
#include <
eagine/timeout.hpp
>
18
19
namespace
eagine::application
{
20
//------------------------------------------------------------------------------
21
class
example :
public
application {
22
public
:
23
example(execution_context&, video_context&);
24
25
auto
is_done() noexcept ->
bool
final {
26
return
_is_done.is_expired();
27
}
28
29
void
on_video_resize() noexcept final;
30
void
update() noexcept final;
31
void
clean_up() noexcept final;
32
33
auto ctx() noexcept -> auto& {
34
return
_ctx;
35
}
36
37
auto
video() noexcept -> auto& {
38
return
_video;
39
}
40
41
auto
cleanup() noexcept -> auto& {
42
return
_cleanup;
43
}
44
45
auto
camera() noexcept -> auto& {
46
return
_camera;
47
}
48
49
private
:
50
cleanup_group _cleanup;
51
execution_context& _ctx;
52
video_context& _video;
53
timeout _is_done{std::chrono::seconds{30}};
54
55
orbiting_camera _camera;
56
draw_program _draw_prog;
57
screen_program _screen_prog;
58
shape_geometry _shape;
59
screen_geometry _screen;
60
draw_buffers _draw_bufs;
61
};
62
//------------------------------------------------------------------------------
63
}
// namespace eagine::application
64
65
#endif
eagine::application
Application harness / wrapper code is placed in this namespace.
Definition:
eagine.hpp:72
camera.hpp
timeout.hpp
cleanup_group.hpp
interface.hpp
Copyright © 2015-2021
Matúš Chochlík
.
<
chochlik -at -gmail.com
>
Documentation generated on Tue Apr 13 2021 by
Doxygen
(version 1.8.17).