Go to the documentation of this file. 1 #ifndef EGLPLUS_EGL_API_RESULT_HPP
9 #define EGLPLUS_EGL_API_RESULT_HPP
30 return {
"EGL function not available"};
43 explicit constexpr
operator bool() const noexcept {
44 return egl_types::error_code_no_error(_error_code);
54 #ifdef EGL_BAD_SURFACE
55 if(_error_code == EGL_BAD_SURFACE) {
56 return {
"bad surface"};
59 #ifdef EGL_BAD_CURRENT_SURFACE
60 if(_error_code == EGL_BAD_CURRENT_SURFACE) {
61 return {
"bad current surface"};
64 #ifdef EGL_BAD_DISPLAY
65 if(_error_code == EGL_BAD_DISPLAY) {
66 return {
"bad display"};
69 #ifdef EGL_CONTEXT_LOST
70 if(_error_code == EGL_CONTEXT_LOST) {
71 return {
"EGL context lost"};
74 #ifdef EGL_BAD_PARAMETER
75 if(_error_code == EGL_BAD_PARAMETER) {
76 return {
"invalid parameter"};
79 #ifdef EGL_BAD_ATTRIBUTE
80 if(_error_code == EGL_BAD_ATTRIBUTE) {
81 return {
"unrecognized attribute or attribute value"};
85 if(_error_code == EGL_BAD_CONFIG) {
86 return {
"invalid configuration"};
89 #ifdef EGL_BAD_CONTEXT
90 if(_error_code == EGL_BAD_CONTEXT) {
91 return {
"invalid context"};
94 #ifdef EGL_BAD_NATIVE_PIXMAP
95 if(_error_code == EGL_BAD_NATIVE_PIXMAP) {
96 return {
"bad native pixmap"};
99 #ifdef EGL_BAD_NATIVE_WINDOW
100 if(_error_code == EGL_BAD_NATIVE_WINDOW) {
101 return {
"bad native window"};
105 if(_error_code == EGL_BAD_MATCH) {
106 return {
"inconsistent attributes"};
109 #ifdef EGL_BAD_ACCESS
110 if(_error_code == EGL_BAD_ACCESS) {
111 return {
"cannot access requested resource"};
114 #ifdef EGL_NOT_INITIALIZED
115 if(_error_code == EGL_NOT_INITIALIZED) {
116 return {
"EGL not initialized"};
119 #ifdef EGL_BAD_STREAM_KHR
120 if(_error_code == EGL_BAD_STREAM_KHR) {
121 return {
"bad EGL stream"};
124 #ifdef EGL_BAD_OUTPUT_LAYER_EXT
125 if(_error_code == EGL_BAD_OUTPUT_LAYER_EXT) {
126 return {
"bad EGL output layer"};
129 #ifdef EGL_BAD_OUTPUT_PORT_EXT
130 if(_error_code == EGL_BAD_OUTPUT_PORT_EXT) {
131 return {
"bad EGL output port"};
134 #ifdef EGL_BAD_STATE_KHR
135 if(_error_code == EGL_BAD_STATE_KHR) {
136 return {
"bad EGL state"};
140 if(_error_code == EGL_SUCCESS) {
145 if(_error_code == EGL_BAD_ALLOC) {
146 return {
"out of memory"};
149 return {
"unknown error"};
164 template <
typename Result>
171 template <
typename Result>
178 template <
typename Result>
183 #endif // EGLPLUS_EGL_API_RESULT_HPP
Class wrapping the result of a C-API function call.
Definition: c_api_wrap.hpp:210
api_no_result< Result, egl_no_result_info > egl_no_result
Alias for always-invalid result of a missing EGL API function call.
Definition: result.hpp:165
Class storing information about call result for unavailable EGL functions.
Definition: result.hpp:22
EGL-related code is placed in this namespace.
Definition: eglplus.hpp:11
Typed enumeration for EGL error code constants.
Definition: enum_types.hpp:31
auto message() const noexcept -> string_view
Returns a message associated with the result.
Definition: result.hpp:53
api_opt_result< Result, egl_result_info > egl_opt_result
Alias for conditionally-valid result of a EGL API function call.
Definition: result.hpp:179
api_result< Result, Info, api_result_validity::maybe > api_opt_result
Alias for conditionally-valid result of a C-API function call.
Definition: c_api_wrap.hpp:218
api_result< Result, Info, api_result_validity::never > api_no_result
Alias for always-invalid result of a C-API function call.
Definition: c_api_wrap.hpp:226
Class storing information about an EGL function call result.
Definition: result.hpp:40
EGLint int_type
Signed integer type.
Definition: config.hpp:116
Type that can by constructed from single argument of any other type.
Definition: anything.hpp:16
constexpr auto message() const noexcept -> string_view
Returns a message associated with the result.
Definition: result.hpp:29