Branch data Line data Source code
1 : : #pragma once
2 : :
3 : : /*
4 : : MIT License
5 : :
6 : : Copyright (c) 2014-2024 Stephane Cuillerdier (aka aiekick)
7 : :
8 : : Permission is hereby granted, free of charge, to any person obtaining a copy
9 : : of this software and associated documentation files (the "Software"), to deal
10 : : in the Software without restriction, including without limitation the rights
11 : : to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 : : copies of the Software, and to permit persons to whom the Software is
13 : : furnished to do so, subject to the following conditions:
14 : :
15 : : The above copyright notice and this permission notice shall be included in all
16 : : copies or substantial portions of the Software.
17 : :
18 : : THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 : : IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 : : FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 : : AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 : : LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 : : OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 : : SOFTWARE.
25 : : */
26 : :
27 : : // ezGL is part of the ezLibs project : https://github.com/aiekick/ezLibs.git
28 : :
29 : :
30 : : #ifdef OPENGL_LOADER
31 : : #include OPENGL_LOADER
32 : : #endif // OPENGL_LOADER
33 : :
34 : : #ifdef PROFILER_INCLUDE
35 : : #include PROFILER_INCLUDE
36 : : #endif // PROFILER_SCOPED
37 : :
38 : : /*
39 : : #ifdef PROFILER_SCOPED
40 : : #define PROFILER_SCOPED
41 : : #endif // PROFILER_SCOPED
42 : : */
43 : :
44 : : /*
45 : : #ifdef PROFILER_SCOPED_PTR
46 : : #define PROFILER_SCOPED_PTR
47 : : #endif // PROFILER_SCOPED_PTR
48 : : */
49 : :
50 : : #ifdef IMGUI_INCLUDE
51 : : #include IMGUI_INCLUDE
52 : : #endif // IMGUI_INCLUDE
53 : :
54 : : #ifdef MSVC
55 : : #define __PRETTY_FUNCTION__ __FUNCSIG__
56 : : #endif
57 : :
58 : : #include <ezlibs/ezStr.hpp>
59 : : #include <ezlibs/ezLog.hpp>
60 : : #include <ezlibs/ezMath.hpp>
61 : :
62 : : #include <string>
63 : :
64 : : namespace ez {
65 : : namespace gl {
66 : :
67 : 0 : static inline void checkGLErrors(const char* vFile, const char* vFunc, const int& vLine) {
68 : 0 : #ifdef _DEBUG
69 : 0 : const GLenum err(glGetError());
70 : 0 : if (err != GL_NO_ERROR) {
71 : 0 : std::string error;
72 : 0 : switch (err) {
73 : 0 : case GL_INVALID_OPERATION: error = "INVALID_OPERATION"; break;
74 : 0 : case GL_INVALID_ENUM: error = "INVALID_ENUM"; break;
75 : 0 : case GL_INVALID_VALUE: error = "INVALID_VALUE"; break;
76 : 0 : case GL_OUT_OF_MEMORY: error = "OUT_OF_MEMORY"; break;
77 : 0 : case GL_INVALID_FRAMEBUFFER_OPERATION: error = "INVALID_FRAMEBUFFER_OPERATION"; break;
78 : 0 : case GL_STACK_UNDERFLOW: error = "GL_STACK_UNDERFLOW"; break;
79 : 0 : case GL_STACK_OVERFLOW: error = "GL_STACK_OVERFLOW"; break;
80 : 0 : }
81 : 0 : LogVarLightError("[%s][%s][%i] GL Errors : %s", vFile, vFunc, vLine, error.c_str());
82 : 0 : }
83 : 0 : #else
84 : 0 : (void)vFile;
85 : 0 : (void)vFunc;
86 : 0 : (void)vLine;
87 : 0 : #endif
88 : 0 : }
89 : :
90 : : } // namespace gl
91 : : } // namespace ez
92 : :
93 : : #define CheckGLErrors ez::gl::checkGLErrors(__FILE__, __FUNCTION__, __LINE__)
94 : :
95 : : // the order is important
96 : : // so dont reorder these includes
97 : :
98 : : // 'auto' mean auto configuration
99 : : // uniform params from code
100 : : // fbo params from code
101 : : // like SoGLSL
102 : :
103 : : #include "texture.hpp"
104 : : #include "fbo.hpp"
105 : : #include "bufferBlock.hpp"
106 : : #include "mesh.hpp"
107 : : // #include "meshVfx.hpp"
108 : : #include "quadMesh.hpp"
109 : : #include "procMesh.hpp"
110 : : #include "uniforms.hpp"
111 : : #include "shader.hpp"
112 : : #include "shaderauto.hpp"
113 : : #include "program.hpp"
114 : : #include "programauto.hpp"
115 : : #include "quadVfx.hpp"
116 : : #include "quadVfxauto.hpp"
117 : : #include "canvas.hpp"
118 : : #include "bufferBlock.hpp"
|