diff --git a/fixqopengl.h b/fixqopengl.h new file mode 100644 index 0000000000..7287adfa19 --- /dev/null +++ b/fixqopengl.h @@ -0,0 +1,37 @@ +/******************************************************************** + KWin - the KDE window manager + This file is part of the KDE project. + +Copyright (C) 2018 Bhushan Shah + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*********************************************************************/ + +#ifndef FIXQOPENGL_H +#define FIXQOPENGL_H + +// qopengl.h declares GLdouble as a typedef of float when Qt is built +// with GLES support. This conflicts with the epoxy/gl_generated.h +// declaration, so we have to prevent the Qt header from being #included. +#define QOPENGL_H + +#ifndef QOPENGLF_APIENTRY +#define QOPENGLF_APIENTRY GLAPIENTRY +#endif + +#ifndef QOPENGLF_APIENTRYP +#define QOPENGLF_APIENTRYP GLAPIENTRYP +#endif + +#endif //FIXQOPENGL_H diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index f5febc05b7..cb571dab91 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -19,6 +19,9 @@ along with this program. If not, see . *********************************************************************/ #include "kwinglplatform.h" +// include kwinglutils_funcs.h to avoid the redeclaration issues +// between qopengl.h and epoxy/gl.h +#include "kwinglutils_funcs.h" #include #include diff --git a/platform.h b/platform.h index e88dff5299..ff40db7b97 100644 --- a/platform.h +++ b/platform.h @@ -22,6 +22,8 @@ along with this program. If not, see . #include #include #include +#include "fixqopengl.h" + #include #include #include diff --git a/plugins/qpa/abstractplatformcontext.h b/plugins/qpa/abstractplatformcontext.h index 5474fceece..984679a275 100644 --- a/plugins/qpa/abstractplatformcontext.h +++ b/plugins/qpa/abstractplatformcontext.h @@ -21,6 +21,7 @@ along with this program. If not, see . #define KWIN_QPA_ABSTRACTPLATFORMCONTEXT_H #include +#include "fixqopengl.h" #include #include diff --git a/plugins/qpa/integration.h b/plugins/qpa/integration.h index 613e5aff3c..d8bf6bcbec 100644 --- a/plugins/qpa/integration.h +++ b/plugins/qpa/integration.h @@ -21,6 +21,8 @@ along with this program. If not, see . #define KWIN_QPA_INTEGRATION_H #include +#include "fixqopengl.h" + #include #include #include diff --git a/plugins/qpa/window.h b/plugins/qpa/window.h index 76f8cd2cb7..e8caedc6e0 100644 --- a/plugins/qpa/window.h +++ b/plugins/qpa/window.h @@ -21,6 +21,8 @@ along with this program. If not, see . #define KWIN_QPA_WINDOW_H #include +#include "fixqopengl.h" + #include #include // wayland