File: testing_context.py

package info (click to toggle)
pyopengl 3.0.0~b6-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,696 kB
  • ctags: 26,182
  • sloc: python: 34,233; ansic: 70; sh: 26; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 628 bytes parent folder | download
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