1 /* 2 KWin - the KDE window manager 3 This file is part of the KDE project. 4 5 SPDX-FileCopyrightText: 2007 Rivo Laks <rivolaks@hot.ee> 6 7 SPDX-License-Identifier: GPL-2.0-or-later 8 */ 9 10 #ifndef KWIN_GLUTILS_FUNCS_H 11 #define KWIN_GLUTILS_FUNCS_H 12 13 #include <kwinglutils_export.h> 14 15 #include <epoxy/gl.h> 16 #include <functional> 17 18 // qopengl.h declares GLdouble as a typedef of float when Qt is built 19 // with GLES support. This conflicts with the epoxy/gl_generated.h 20 // declaration, so we have to prevent the Qt header from being #included. 21 #define QOPENGL_H 22 23 #ifndef QOPENGLF_APIENTRY 24 #define QOPENGLF_APIENTRY GLAPIENTRY 25 #endif 26 27 #ifndef QOPENGLF_APIENTRYP 28 #define QOPENGLF_APIENTRYP GLAPIENTRYP 29 #endif 30 31 namespace KWin 32 { 33 34 typedef void (*resolveFuncPtr)(); 35 void KWINGLUTILS_EXPORT glResolveFunctions(const std::function<resolveFuncPtr(const char*)> &resolveFunction); 36 37 // GL_ARB_robustness / GL_EXT_robustness 38 using glGetGraphicsResetStatus_func = GLenum (*)(); 39 using glReadnPixels_func = void (*)(GLint x, GLint y, GLsizei width, GLsizei height, 40 GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); 41 using glGetnUniformfv_func = void (*)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params); 42 43 extern KWINGLUTILS_EXPORT glGetGraphicsResetStatus_func glGetGraphicsResetStatus; 44 extern KWINGLUTILS_EXPORT glReadnPixels_func glReadnPixels; 45 extern KWINGLUTILS_EXPORT glGetnUniformfv_func glGetnUniformfv; 46 47 } // namespace 48 49 #endif // KWIN_GLUTILS_FUNCS_H 50