File: testing_context.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 (26 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (8)
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
import pygame
from pygame.locals import *
import pygame.key
import pygame.display
from OpenGL.GLUT import *


def createPyGameContext():
    """Setup a minimal PyGame context for testing"""
    pygame.display.init()
    screen = pygame.display.set_mode(
        (300,300),
        OPENGL | DOUBLEBUF,
    )
    pygame.display.set_caption("testing")
    pygame.key.set_repeat(500,30)
    return pygame.display

def createGLUTContext():
    """Setup a minimal GLUT context for testing"""
    glutInit( [] )
    glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB )
    glutInitWindowSize(250, 250)
    glutInitWindowPosition(100, 100)
    window = glutCreateWindow("hello")
    return window