fennec
Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1// =====================================================================================================================
2// fennec, a free and open source game engine
3// Copyright © 2025 Medusa Slockbower
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17// =====================================================================================================================
18
30
31
32#ifndef FENNEC_PLATFORM_OPENGL_EGL_ERROR_H
33#define FENNEC_PLATFORM_OPENGL_EGL_ERROR_H
34
35#include <EGL/egl.h>
36#include <fennec/string/cstring.h>
37
38inline fennec::cstring eglErrorString(EGLint err) {
39 switch (err) {
40 case EGL_SUCCESS: return "None";
41 case EGL_NOT_INITIALIZED: return "Not Initialized";
42 case EGL_BAD_ACCESS: return "Bad Access";
43 case EGL_BAD_ALLOC: return "Bad Alloc";
44 case EGL_BAD_ATTRIBUTE: return "Bad Attribute";
45 case EGL_BAD_CONTEXT: return "Bad Context";
46 case EGL_BAD_CONFIG: return "Bad Config";
47 case EGL_BAD_CURRENT_SURFACE: return "Bad Current Surface";
48 case EGL_BAD_DISPLAY: return "Bad Display";
49 case EGL_BAD_SURFACE: return "Bad Surface";
50 case EGL_BAD_MATCH: return "Bad Match";
51 case EGL_BAD_PARAMETER: return "Bad Parameter";
52 case EGL_BAD_NATIVE_PIXMAP: return "Bad Native Pixmap";
53 case EGL_BAD_NATIVE_WINDOW: return "Bad Native Window";
54 case EGL_CONTEXT_LOST: return "Context Lost";
55 default: return "Unknown Error";
56 }
57}
58
59#endif // FENNEC_PLATFORM_OPENGL_EGL_ERROR_H
This struct wraps c-style strings.
Definition cstring.h:64