~mcfletch/openglcontext/trunk : /tests/glvertex.py (revision 351)

Line Revision Contents
1 1
#! /usr/bin/env python
2
'''Test of the glVertex function (draws flower)'''
3
from OpenGLContext import testingcontext
4 296
BaseContext = testingcontext.getInteractive()
5 1
from OpenGL.GL import *
6
from OpenGLContext.arrays import array
7 5
import flower_geometry
8 1
9
class TestContext( BaseContext ):
10
	def OnInit( self ):
11
		"""Initialisation"""
12
		print """Should see flower pattern in gray over white background"""
13
	def Render( self, mode = 0):
14
		BaseContext.Render( self, mode )
15
		glBegin( GL_TRIANGLES )
16
		for index in flower_geometry.indices:
17
			glVertex3dv( flower_geometry.points[index] )
18
		glEnd()
19
20
if __name__ == "__main__":
21 296
	TestContext.ContextMainLoop()

Loggerhead 1.10 is a web-based interface for Bazaar branches