Kale
Loading...
Searching...
No Matches
Utils.hpp
Go to the documentation of this file.
1/*
2 Copyright 2022 Rishi Challa
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#pragma once
18
19#ifdef KALE_OPENGL
20
21#include <map>
22
23#include <glad/glad.h>
24
25namespace Kale::OpenGL {
26
31 template <typename T> GLenum getEnumValue(T value) {
32 return static_cast<GLenum>(value);
33 }
34
35#ifdef KALE_DEBUG
36
37 inline const std::map<GLenum, const char*> enumStringValueMap = {
38 {GL_DEBUG_SOURCE_API, "OpenGL API"},
39 {GL_DEBUG_SOURCE_APPLICATION, "Application"},
40 {GL_DEBUG_SOURCE_OTHER, "Other"},
41 {GL_DEBUG_SOURCE_SHADER_COMPILER, "Shader Compiler"},
42 {GL_DEBUG_SOURCE_THIRD_PARTY, "Third Party"},
43 {GL_DEBUG_SOURCE_WINDOW_SYSTEM, "Window System"},
44
45 {GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, "Deprecated Behavior"},
46 {GL_DEBUG_TYPE_ERROR, "Error"},
47 {GL_DEBUG_TYPE_MARKER, "Marker"},
48 {GL_DEBUG_TYPE_OTHER, "Other"},
49 {GL_DEBUG_TYPE_PERFORMANCE, "Performance"},
50 {GL_DEBUG_TYPE_POP_GROUP, "Pop Group"},
51 {GL_DEBUG_TYPE_PORTABILITY, "Portability"},
52 {GL_DEBUG_TYPE_PUSH_GROUP, "Push Group"},
53 {GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, "Undefined Behavior"},
54
55 {GL_DEBUG_SEVERITY_HIGH, "High"},
56 {GL_DEBUG_SEVERITY_LOW, "Low"},
57 {GL_DEBUG_SEVERITY_MEDIUM, "Medium"},
58 {GL_DEBUG_SEVERITY_NOTIFICATION, "Notification"}
59 };
60
61#endif
62
63}
64
65#endif
GLenum getEnumValue(T value)
Definition Utils.hpp:31