diff --git a/lib/kwinglutils_funcs.cpp b/lib/kwinglutils_funcs.cpp
index 4d03ca5fc3..5f007d0a30 100644
--- a/lib/kwinglutils_funcs.cpp
+++ b/lib/kwinglutils_funcs.cpp
@@ -33,6 +33,7 @@ along with this program. If not, see .
function = (function ## _func)getProcAddress( #backup );
#ifdef KWIN_HAVE_OPENGL
+#ifndef KWIN_HAVE_OPENGLES
namespace KWin
{
@@ -297,3 +298,4 @@ void glResolveFunctions()
} // namespace
#endif
+#endif
diff --git a/lib/kwinglutils_funcs.h b/lib/kwinglutils_funcs.h
index 98ff25f9d4..7f60108b3a 100644
--- a/lib/kwinglutils_funcs.h
+++ b/lib/kwinglutils_funcs.h
@@ -29,6 +29,8 @@ along with this program. If not, see .
#ifdef KWIN_HAVE_OPENGL
+#ifndef KWIN_HAVE_OPENGLES
+
// gcc-3.3.3 apparently cannot resolve KWin's namespaced versions properly,
// so hide possible global functions
#define glXQueryDrawable kwinhide_glXQueryDrawable
@@ -345,6 +347,10 @@ extern KWIN_EXPORT glVertexAttribPointer_func glVertexAttribPointer;
} // namespace
+#else
+#include
+#endif
+
#endif
#endif