From 39a3756b5cb41dfa1ee33c0bb7cb85838067ae07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 9 Aug 2015 19:55:35 +0200 Subject: [PATCH] doc: mention potential VAO issues when interacting with third-party GL code. --- doc/opengl-wrapping.dox | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/opengl-wrapping.dox b/doc/opengl-wrapping.dox index 7c57346b0..bc0afacd2 100644 --- a/doc/opengl-wrapping.dox +++ b/doc/opengl-wrapping.dox @@ -121,6 +121,13 @@ Note that it is currently not possible to do the opposite -- reseting all state touched by Magnum to previous values -- as it would involve impractically large amount of queries and state switches with serious performance impact. +Magnum by default uses VAOs -- each time a @ref Mesh is drawn or configured, +its VAO is bound, but it is *not* unbound afterwards to avoid needless state +changes. This may introduce problems when using third-party OpenGL code that +does not use VAOs -- it will break internal state of Mesh that was used most +recently. The solution, besides state resetting, is to create a new VAO and +bind it every time the third-party OpenGL code is called. + @section opengl-wrapping-dsa Extension-dependent functionality While the majority of Magnum API stays the same on all platforms and driver