Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ErrorCodes.h
Go to the documentation of this file.
1/*
2Copyright (c) 2018 DIVIDE-Studio
3Copyright (c) 2009 Ionut Cava
4
5This file is part of DIVIDE Framework.
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software
9and associated documentation files (the "Software"), to deal in the Software
10without restriction,
11including without limitation the rights to use, copy, modify, merge, publish,
12distribute, sublicense,
13and/or sell copies of the Software, and to permit persons to whom the
14Software is furnished to do so,
15subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED,
22INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23PARTICULAR PURPOSE AND NONINFRINGEMENT.
24IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25DAMAGES OR OTHER LIABILITY,
26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27IN CONNECTION WITH THE SOFTWARE
28OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30*/
31
32#pragma once
33#ifndef DVD_CORE_ERROR_CODES_H_
34#define DVD_CORE_ERROR_CODES_H_
35
36namespace Divide {
37 enum class ErrorCode : I8 {
38 NO_ERR = 0,
74 COUNT
75 };
76
77 namespace Names
78 {
79 static const char* errorCode[] = {
80 "NO ERROR",
81 "MISSING SCENE DATA",
82 "MISSING PROJECT DATA",
83 "MISSING SCENE LOAD CALL",
84 "CPU NOT SUPPORTED",
85 "RENDERING API NOT SUPPORTED",
86 "RENDERING API NOT SPECIFIED",
87 "SOUND API NOT SPECIFIED",
88 "PHYSICS API NON SPECIFIED",
89 "WINDOW INIT ERROR",
90 "SDL WINDOW INIT ERROR",
91 "FONT INIT ERROR",
92 "GLBINGING INIT ERROR",
93 "GLSL INIT ERROR",
94 "OPENGL OLD HARDWARE",
95 "VULKAN OLD HARDWARE",
96 "GPU UNDER MIN SPEC",
97 "VULKAN SURFACE CREATE",
98 "VULKAN DEVICE CREATE FAILED",
99 "VULKAN NO GRAHPICS QUEUE",
100 "VULKAN NO PRESENT QUEUE",
101 "SDL AUDIO INIT ERROR",
102 "SDL AUDIO MIX INIT ERROR",
103 "FMOD AUDIO INIT ERROR",
104 "OPENAL INIT ERROR",
105 "OPENCL INIT ERROR",
106 "PHYSX INIT ERROR",
107 "PHYSX EXTENSION ERROR",
108 "NO LANGUAGE INI",
109 "NOT ENOUGH RAM",
110 "WRONG WORKING DIRECTORY",
111 "PLATFORM INIT ERROR",
112 "PLATFORM CLOSE ERROR",
113 "PATHS ERROR",
114 "EDITOR INIT ERROR",
115 "GUI INIT ERROR",
116 "UNKNOWN"
117 };
118 }
119
120 namespace TypeUtil
121 {
122 [[nodiscard]] inline const char* ErrorCodeToString( const ErrorCode err ) noexcept
123 {
124 return Names::errorCode[to_base( err )];
125 }
126 }
127}
128
129#endif //DVD_CORE_ERROR_CODES_H_
static const char * errorCode[]
Definition: ErrorCodes.h:79
const char * ErrorCodeToString(const ErrorCode err) noexcept
Definition: ErrorCodes.h:122
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
constexpr auto to_base(const Type value) -> Type