File: vboimplementation.py

package info (click to toggle)
pyopengl 3.1.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,668 kB
  • sloc: python: 108,024; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from OpenGL.arrays import vbo
from OpenGL.GL.VERSION import GL_1_5, GL_3_0, GL_3_1

class Implementation( vbo.Implementation ):
    """OpenGL-based implementation of VBO interfaces"""
    def __init__( self ):
        for name in self.EXPORTED_NAMES:
            found = False
            for source in (GL_1_5,GL_3_0, GL_3_1):
                try:
                    setattr( self, name, getattr( source, name ))
                except AttributeError as err:
                    pass 
                else:
                    found = True 
                    break 
            assert found, name
        if GL_1_5.glBufferData:
            self.available = True

Implementation.register()