From d324ec998a5e249bd91147cc18ffb9251f2af86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 13 Mar 2013 17:03:30 +0100 Subject: [PATCH] kwin: Create a vertex array object in SceneOpenGL2 Using a vertex array object is not optional in an OpenGL core context. --- scene_opengl.cpp | 11 +++++++++++ scene_opengl.h | 1 + 2 files changed, 12 insertions(+) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 9c1e98ca4a..889f07e0c3 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -617,7 +617,18 @@ SceneOpenGL2::SceneOpenGL2(OpenGLBackend *backend) init_ok = false; return; // error } + kDebug(1212) << "OpenGL 2 compositing successfully initialized"; + +#ifndef KWIN_HAVE_OPENGLES + // It is not legal to not have a vertex array object bound in a core context + if (hasGLExtension("GL_ARB_vertex_array_object")) { + glGenVertexArrays(1, &vao); + glBindVertexArray(vao); + } +#endif + + init_ok = true; } SceneOpenGL2::~SceneOpenGL2() diff --git a/scene_opengl.h b/scene_opengl.h index 774057dc3c..cb01664ea4 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -126,6 +126,7 @@ private: private: LanczosFilter *m_lanczosFilter; ColorCorrection *m_colorCorrection; + GLuint vao; }; #ifdef KWIN_HAVE_OPENGL_1