File: test_err_check_extension_check.py

package info (click to toggle)
pyopengl 3.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,216 kB
  • sloc: python: 80,468; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import OpenGL
OpenGL.ERROR_CHECKING = False
OpenGL.USE_ACCELERATE = False

from OpenGL.GLUT import *

def reshape(width, height): pass
def display(): glutSwapBuffers()

def main():
    glutInit([])
    glutInitDisplayMode(GLUT_RGBA|GLUT_3_2_CORE_PROFILE)
    glutCreateWindow(b"test")
    glutReshapeFunc(reshape)
    glutDisplayFunc(display)

    from OpenGL.GL import glGenVertexArrays, glVertex3f
    assert bool(glGenVertexArrays)
    try:
        if fgDeinitialize: fgDeinitialize(False)
    except NameError as err:
        pass # Older PyOpenGL, you may see a seg-fault here...

if __name__ == "__main__":
    main()