1from OpenGL.arrays import vbo
2from OpenGL.GLES2.VERSION import GLES2_2_0
3from OpenGL.GLES2.OES import mapbuffer
4
5class Implementation( vbo.Implementation ):
6    """OpenGL-based implementation of VBO interfaces"""
7    def __init__( self ):
8        for name in self.EXPORTED_NAMES:
9            for source in [ GLES2_2_0, mapbuffer ]:
10                for possible in (name,name+'OES'):
11                    try:
12                        setattr( self, name, getattr( source, possible ))
13                    except AttributeError as err:
14                        pass
15                    else:
16                        found = True
17                assert found, name
18        if GLES2_2_0.glBufferData:
19            self.available = True
20Implementation.register()
21