Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / xbmc / utils / GLUtils.h
blob5c360300dde6ff5549718471b2a51ef44adc1034
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 // GL Error checking macro
12 // this function is useful for tracking down GL errors, which otherwise
13 // just result in undefined behavior and can be difficult to track down.
15 // Just call it 'VerifyGLState()' after a sequence of GL calls
17 // if GL_DEBUGGING and HAS_GL are defined, the function checks
18 // for GL errors and prints the current state of the various matrices;
19 // if not it's just an empty inline stub, and thus won't affect performance
20 // and will be optimized out.
22 #include "system_gl.h"
24 namespace KODI
26 namespace UTILS
28 namespace GL
30 void GlErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
32 int glFormatElementByteCount(GLenum format);
34 enum class ColorChannel
42 uint8_t GetChannelFromARGB(const ColorChannel colorChannel, const uint32_t argb);
47 void _VerifyGLState(const char* szfile, const char* szfunction, int lineno);
48 #if defined(GL_DEBUGGING) && (defined(HAS_GL) || defined(HAS_GLES))
49 #define VerifyGLState() _VerifyGLState(__FILE__, __FUNCTION__, __LINE__)
50 #else
51 #define VerifyGLState()
52 #endif
54 void LogGraphicsInfo();