File indexing completed on 2025-03-23 11:13:59
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2007 Rivo Laks <rivolaks@hot.ee> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #pragma once 0011 0012 #include <kwinglutils_export.h> 0013 0014 #include <epoxy/gl.h> 0015 #include <functional> 0016 0017 // qopengl.h declares GLdouble as a typedef of float when Qt is built 0018 // with GLES support. This conflicts with the epoxy/gl_generated.h 0019 // declaration, so we have to prevent the Qt header from being #included. 0020 #define QOPENGL_H 0021 0022 #ifndef QOPENGLF_APIENTRY 0023 #define QOPENGLF_APIENTRY GLAPIENTRY 0024 #endif 0025 0026 #ifndef QOPENGLF_APIENTRYP 0027 #define QOPENGLF_APIENTRYP GLAPIENTRYP 0028 #endif 0029 0030 namespace KWin 0031 { 0032 0033 typedef void (*resolveFuncPtr)(); 0034 void KWINGLUTILS_EXPORT glResolveFunctions(const std::function<resolveFuncPtr(const char *)> &resolveFunction); 0035 0036 // GL_ARB_robustness / GL_EXT_robustness 0037 using glGetGraphicsResetStatus_func = GLenum (*)(); 0038 using glReadnPixels_func = void (*)(GLint x, GLint y, GLsizei width, GLsizei height, 0039 GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); 0040 using glGetnUniformfv_func = void (*)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params); 0041 0042 extern KWINGLUTILS_EXPORT glGetGraphicsResetStatus_func glGetGraphicsResetStatus; 0043 extern KWINGLUTILS_EXPORT glReadnPixels_func glReadnPixels; 0044 extern KWINGLUTILS_EXPORT glGetnUniformfv_func glGetnUniformfv; 0045 0046 } // namespace