File: test_fbdel.py

package info (click to toggle)
pyopengl 3.1.6%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,732 kB
  • sloc: python: 106,016; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 940 bytes parent folder | download | duplicates (3)
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
31
from __future__ import print_function
from OpenGL.GL import *
from OpenGL.GLUT import *
import sys
import OpenGL.GL.EXT.framebuffer_object as EXT
import OpenGL.GL.ARB.framebuffer_object as ARB

def main():
    glutInit(sys.argv)
    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)	
    glutInitWindowSize(640, 480)	
    glutInitWindowPosition(0, 0)	
    glutCreateWindow("Framebuffer bug demo")

    for i in range( 200 ):
        fbo = EXT.glGenFramebuffersEXT(1)
        print("FBO = ", fbo)
        EXT.glDeleteFramebuffersEXT (int(fbo))
        fbo = ARB.glGenFramebuffers(1)
        print("FBO = ", fbo)
        ARB.glDeleteFramebuffers(int(fbo))
        glFlush()
    try:
        if fgDeinitialize: fgDeinitialize(False)
    except NameError:
        pass # Older PyOpenGL, you may see a seg-fault here...

# Print message to console, and kick off the main to get it rolling.
if __name__ == "__main__":
    main()