KWin
Loading...
Searching...
No Matches
glutils.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2006-2007 Rivo Laks <rivolaks@hot.ee>
6 SPDX-FileCopyrightText: 2010, 2011 Martin Gräßlin <mgraesslin@kde.org>
7 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@kde.org>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11#pragma once
12
13#include "core/colorspace.h"
15#include "opengl/glshader.h"
17#include "opengl/gltexture.h"
20
21#include <QByteArray>
22#include <QList>
23#include <functional>
24
25namespace KWin
26{
27
28// Initializes OpenGL stuff. This includes resolving function pointers as
29// well as checking for GL version and extensions
30// Note that GL context has to be created by the time this function is called
31typedef void (*resolveFuncPtr)();
32void KWIN_EXPORT initGL(const std::function<resolveFuncPtr(const char *)> &resolveFunction);
33// Cleans up all resources hold by the GL Context
34void KWIN_EXPORT cleanupGL();
35
36bool KWIN_EXPORT hasGLVersion(int major, int minor, int release = 0);
37// use for both OpenGL and GLX extensions
38bool KWIN_EXPORT hasGLExtension(const QByteArray &extension);
39
40// detect OpenGL error (add to various places in code to pinpoint the place)
41bool KWIN_EXPORT checkGLError(const char *txt);
42
43QList<QByteArray> KWIN_EXPORT openGLExtensions();
44
45} // namespace
46
bool checkGLError(const char *txt)
Definition glutils.cpp:170
void(* resolveFuncPtr)()
Definition glutils.h:31
void KWIN_EXPORT cleanupGL()
Definition glutils.cpp:122
void initGL(const std::function< resolveFuncPtr(const char *)> &resolveFunction)
Definition glutils.cpp:97
QList< QByteArray > openGLExtensions()
Definition glutils.cpp:143
bool hasGLVersion(int major, int minor, int release)
Definition glutils.cpp:133
bool hasGLExtension(const QByteArray &extension)
Definition glutils.cpp:138