File indexing completed on 2025-04-27 05:04:02
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2006-2007 Rivo Laks <rivolaks@hot.ee> 0006 SPDX-FileCopyrightText: 2010, 2011 Martin Gräßlin <mgraesslin@kde.org> 0007 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@kde.org> 0008 0009 SPDX-License-Identifier: GPL-2.0-or-later 0010 */ 0011 #pragma once 0012 0013 #include "core/colorspace.h" 0014 #include "opengl/glframebuffer.h" 0015 #include "opengl/glshader.h" 0016 #include "opengl/glshadermanager.h" 0017 #include "opengl/gltexture.h" 0018 #include "opengl/glutils_funcs.h" 0019 #include "opengl/glvertexbuffer.h" 0020 0021 #include <QByteArray> 0022 #include <QList> 0023 #include <functional> 0024 0025 namespace KWin 0026 { 0027 0028 // Initializes OpenGL stuff. This includes resolving function pointers as 0029 // well as checking for GL version and extensions 0030 // Note that GL context has to be created by the time this function is called 0031 typedef void (*resolveFuncPtr)(); 0032 void KWIN_EXPORT initGL(const std::function<resolveFuncPtr(const char *)> &resolveFunction); 0033 // Cleans up all resources hold by the GL Context 0034 void KWIN_EXPORT cleanupGL(); 0035 0036 bool KWIN_EXPORT hasGLVersion(int major, int minor, int release = 0); 0037 // use for both OpenGL and GLX extensions 0038 bool KWIN_EXPORT hasGLExtension(const QByteArray &extension); 0039 0040 // detect OpenGL error (add to various places in code to pinpoint the place) 0041 bool KWIN_EXPORT checkGLError(const char *txt); 0042 0043 QList<QByteArray> KWIN_EXPORT openGLExtensions(); 0044 0045 } // namespace 0046 0047 /** @} */