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

config.hpp
Go to the documentation of this file.
1 #ifndef EGLPLUS_EGL_API_CONFIG_HPP
9 #define EGLPLUS_EGL_API_CONFIG_HPP
10 
11 #include "../config/basic.hpp"
12 #include <eagine/maybe_unused.hpp>
13 
14 #ifndef EGLPLUS_HAS_EGL
15 #if defined(EGL_SUCCESS)
16 #define EGLPLUS_HAS_EGL 1
17 
18 #ifndef EGL_BAD_STREAM_KHR
19 #define EGL_BAD_STREAM_KHR 0x321B
20 #endif
21 
22 #ifndef EGL_BAD_STATE_KHR
23 #define EGL_BAD_STATE_KHR 0x321C
24 #endif
25 
26 #ifndef EGL_PLATFORM_DEVICE_EXT
27 #define EGL_PLATFORM_DEVICE_EXT 0x313F
28 #endif
29 
30 #ifndef EGL_BAD_OUTPUT_LAYER_EXT
31 #define EGL_BAD_OUTPUT_LAYER_EXT 0x322D
32 #endif
33 
34 #ifndef EGL_BAD_OUTPUT_PORT_EXT
35 #define EGL_BAD_OUTPUT_PORT_EXT 0x322E
36 #endif
37 
38 #else
39 #define EGLPLUS_HAS_EGL 0
40 #endif
41 #endif // EGLPLUS_HAS_EGL
42 
43 #if !EGLPLUS_HAS_EGL
44 #include <eagine/nothing.hpp>
45 #include <cstdint>
46 #endif
47 
48 namespace eagine::eglp {
49 //------------------------------------------------------------------------------
52 struct egl_types {
54  using void_ptr_type = void*;
55 
57  using char_type = char;
58 
60  using device_type = void*;
61 
63  using stream_type = void*;
64 
66  using output_layer_type = void*;
67 
69  using output_port_type = void*;
70 #if EGLPLUS_HAS_EGL
71  static constexpr bool has_api = true;
72 
74  using native_display_type = EGLNativeDisplayType;
75 
77  using native_window_type = EGLNativeWindowType;
78 
80  using native_pixmap_type = EGLNativePixmapType;
81 
83  using client_buffer_type = EGLClientBuffer;
84 
86  using display_type = EGLDisplay;
87 
89  using config_type = EGLConfig;
90 
92  using attrib_type = EGLAttrib;
93 
95  using context_type = EGLContext;
96 
98  using surface_type = EGLSurface;
99 
101  using image_type = EGLImage;
102 
104  using sync_type = EGLSync;
105 
107  using time_type = EGLTime;
108 
110  using bool_type = EGLBoolean;
111 
113  using enum_type = EGLenum;
114 
116  using int_type = EGLint;
117 #else
118  static constexpr bool has_api = false;
123  using display_type = nothing_t;
124  using config_type = nothing_t;
125  using attrib_type = std::intptr_t;
126  using context_type = nothing_t;
127  using surface_type = nothing_t;
128  using image_type = nothing_t;
129  using sync_type = nothing_t;
130  using time_type = nothing_t;
131  using bool_type = bool;
132  using enum_type = int;
133  using int_type = int;
134 #endif
135 
136  static constexpr auto bool_true(bool_type b) noexcept -> bool {
137 #if EGLPLUS_HAS_EGL
138  return b == EGL_TRUE;
139 #else
140  return b;
141 #endif
142  }
143 
144  static constexpr auto error_code_no_error(int_type ec) noexcept -> bool {
145 #if EGLPLUS_HAS_EGL
146  return ec == EGL_SUCCESS;
147 #else
148  EAGINE_MAYBE_UNUSED(ec);
149  return false;
150 #endif
151  }
152 };
153 //------------------------------------------------------------------------------
154 } // namespace eagine::eglp
155 
156 #endif // EGLPLUS_EGL_API_CONFIG_HPP
EGLSync sync_type
Sync object handle type.
Definition: config.hpp:104
char char_type
String character type.
Definition: config.hpp:57
EGL-related code is placed in this namespace.
Definition: eglplus.hpp:11
void * output_layer_type
Output layer handle type.
Definition: config.hpp:66
Class representing "none" / "nothing" values.
Definition: nothing.hpp:17
EGLConfig config_type
Config handle type.
Definition: config.hpp:89
EGLNativePixmapType native_pixmap_type
Native pixmap handle type.
Definition: config.hpp:80
Collection of aliases for EGL types.
Definition: config.hpp:52
EGLNativeDisplayType native_display_type
Native display handle type.
Definition: config.hpp:74
EGLNativeWindowType native_window_type
Native window handle type.
Definition: config.hpp:77
EGLenum enum_type
Enumeration type.
Definition: config.hpp:113
void * output_port_type
Output port handle type.
Definition: config.hpp:69
void * void_ptr_type
Untyped non-const pointer type.
Definition: config.hpp:54
EGLSurface surface_type
Rendering surface handle type.
Definition: config.hpp:98
void * device_type
Device handle type.
Definition: config.hpp:60
EGLContext context_type
Rendering context handle type.
Definition: config.hpp:95
EGLClientBuffer client_buffer_type
Client buffer handle type.
Definition: config.hpp:83
void * stream_type
Stream handle type.
Definition: config.hpp:63
EGLTime time_type
Time type.
Definition: config.hpp:107
EGLAttrib attrib_type
Config attribute handle type.
Definition: config.hpp:92
EGLint int_type
Signed integer type.
Definition: config.hpp:116
EGLBoolean bool_type
Boolean type.
Definition: config.hpp:110
EGLImage image_type
EGL image type.
Definition: config.hpp:101
EGLDisplay display_type
EGL display handle type.
Definition: config.hpp:86

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