File: check_glutinit.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 (30 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
from __future__ import print_function
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import time

resX,resY = (400,300 )

def display( ):
    glutSetWindow(window);
    glClearColor (0.0, 0.0, (time.time()%1.0)/1.0, 0.0)
    glClear (GL_COLOR_BUFFER_BIT)
    glFlush ()
    glutSwapBuffers()


if __name__ == "__main__":
    glutInit([])
    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)

    glutInitWindowSize(resX, resY)

    glutInitWindowPosition(0, 0)
    window = glutCreateWindow("hello")
    glutDisplayFunc(display)
    for name in (GL_VENDOR,GL_RENDERER,GL_SHADING_LANGUAGE_VERSION,GL_EXTENSIONS):
        print(( '%s = %r'%( name,glGetString(name))))
    
    glutMainLoop()