File indexing completed on 2024-12-01 13:37:31

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2021 Xaver Hugl <xaver.hugl@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include <QString>
0012 #include <epoxy/egl.h>
0013 
0014 static QString getEglErrorString(EGLint errorCode)
0015 {
0016     switch (errorCode) {
0017     case EGL_SUCCESS:
0018         return QStringLiteral("EGL_SUCCESS");
0019     case EGL_NOT_INITIALIZED:
0020         return QStringLiteral("EGL_NOT_INITIALIZED");
0021     case EGL_BAD_ACCESS:
0022         return QStringLiteral("EGL_BAD_ACCESS");
0023     case EGL_BAD_ALLOC:
0024         return QStringLiteral("EGL_BAD_ALLOC");
0025     case EGL_BAD_ATTRIBUTE:
0026         return QStringLiteral("EGL_BAD_ATTRIBUTE");
0027     case EGL_BAD_CONTEXT:
0028         return QStringLiteral("EGL_BAD_CONTEXT");
0029     case EGL_BAD_CONFIG:
0030         return QStringLiteral("EGL_BAD_CONFIG");
0031     case EGL_BAD_CURRENT_SURFACE:
0032         return QStringLiteral("EGL_BAD_CURRENT_SURFACE");
0033     case EGL_BAD_DISPLAY:
0034         return QStringLiteral("EGL_BAD_DISPLAY");
0035     case EGL_BAD_SURFACE:
0036         return QStringLiteral("EGL_BAD_SURFACE");
0037     case EGL_BAD_MATCH:
0038         return QStringLiteral("EGL_BAD_MATCH");
0039     case EGL_BAD_PARAMETER:
0040         return QStringLiteral("EGL_BAD_PARAMETER");
0041     case EGL_BAD_NATIVE_PIXMAP:
0042         return QStringLiteral("EGL_BAD_NATIVE_PIXMAP");
0043     case EGL_BAD_NATIVE_WINDOW:
0044         return QStringLiteral("EGL_BAD_NATIVE_WINDOW");
0045     case EGL_CONTEXT_LOST:
0046         return QStringLiteral("EGL_CONTEXT_LOST");
0047     default:
0048         return QString::number(errorCode, 16);
0049     }
0050 }
0051 
0052 static QString getEglErrorString()
0053 {
0054     return getEglErrorString(eglGetError());
0055 }