OGLplus  (0.59.0) a C++ wrapper for rendering APIs

types.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_APPLICATION_TYPES_HPP
10 #define EAGINE_APPLICATION_TYPES_HPP
11 
12 #include "../reflect/map_enumerators.hpp"
13 #include "../tags.hpp"
14 #include <cstdint>
15 
16 namespace eagine::application {
17 //------------------------------------------------------------------------------
20 enum class video_context_kind : std::uint8_t {
22  opengl,
24  openvg
25 };
26 
27 template <typename Selector>
28 constexpr auto
29 enumerator_mapping(type_identity<video_context_kind>, Selector) noexcept {
30  return enumerator_map_type<video_context_kind, 2>{
31  {{"opengl", video_context_kind::opengl},
32  {"openvg", video_context_kind::openvg}}};
33 }
34 //------------------------------------------------------------------------------
37 enum class audio_context_kind : std::uint8_t {
39  openal
40 };
41 
42 template <typename Selector>
43 constexpr auto
44 enumerator_mapping(type_identity<audio_context_kind>, Selector) noexcept {
45  return enumerator_map_type<audio_context_kind, 1>{
46  {{"openal", audio_context_kind::openal}}};
47 }
48 //------------------------------------------------------------------------------
51 enum class video_device_kind : std::uint8_t {
53  dont_care,
55  hardware,
57  software
58 };
59 
60 template <typename Selector>
61 constexpr auto
62 enumerator_mapping(type_identity<video_device_kind>, Selector) noexcept {
63  return enumerator_map_type<video_device_kind, 3>{
64  {{"dont_care", video_device_kind::dont_care},
65  {"hardware", video_device_kind::hardware},
66  {"software", video_device_kind::software}}};
67 }
68 //------------------------------------------------------------------------------
72 enum class framedump_data_type : std::uint8_t {
74  none,
76  float_type,
78  byte_type
79 };
80 
81 template <typename Selector>
82 constexpr auto
83 enumerator_mapping(type_identity<framedump_data_type>, Selector) noexcept {
84  return enumerator_map_type<framedump_data_type, 3>{
85  {{"none", framedump_data_type::none},
86  {"float_type", framedump_data_type::float_type},
87  {"byte_type", framedump_data_type::byte_type}}};
88 }
89 
90 constexpr auto enumerator_mapping(
91  type_identity<framedump_data_type>,
92  application_config_tag) noexcept {
93  return enumerator_map_type<framedump_data_type, 3>{
94  {{"none", framedump_data_type::none},
97 }
98 //------------------------------------------------------------------------------
102 enum class framedump_pixel_format : std::uint8_t {
104  none,
106  rgba,
108  depth,
110  stencil
111 };
112 
113 template <typename Selector>
114 constexpr auto
115 enumerator_mapping(type_identity<framedump_pixel_format>, Selector) noexcept {
116  return enumerator_map_type<framedump_pixel_format, 4>{
117  {{"none", framedump_pixel_format::none},
120  {"stencil", framedump_pixel_format::stencil}}};
121 }
122 //------------------------------------------------------------------------------
123 } // namespace eagine::application
124 #endif
Application harness / wrapper code is placed in this namespace.
Definition: eagine.hpp:72
framedump_pixel_format
Pixel data format of frame dump image data.
Definition: types.hpp:102
@ rgba
Red, green, blue, alpha color channel data.
@ opengl
OpenGL© (or OpenGL|ES) context.
@ float_type
Floating-point pixel data.
audio_context_kind
Audio / sound playback and recodring context kind.
Definition: types.hpp:37
framedump_data_type
Pixel data type used to store frame dump image data.
Definition: types.hpp:72
@ hardware
Hardware rendering device.
video_device_kind
Video rendering device kind.
Definition: types.hpp:51
video_context_kind
Video / graphics rendering context kind.
Definition: types.hpp:20
@ none
None, not doing frame dump render run.
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
@ software
Software rendering device.

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).