YaGL: Handle non-shareable OpenGL objects properly
In OpenGL 3.1 core profile framebuffers and
vertex arrays are non-shareable between contexts, this
means that it's not safe to delete these types of objects
like we did before. We now keep context id together with
framebuffers and vertex arrays and check it on
object deletion, if current context is different
from the one in which the object was created then
"ensure" context is selected and delete operation is
performed there. This makes sure that the object will
get deleted in case if OpenGL 2.1 is used and that
the delete operation is a no-op in case of OpenGL 3.1
core profile. In case of OpenGL 3.1 the object will
eventually be deleted once context is deleted
Change-Id: I4929a0590d96ae00e46d04a49b9b387a6673330b
13 files changed: