| Line | Revision | Contents |
| 1 | 1 | #! /usr/bin/env python |
| 2 | '''Test of the glArrayElement 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 | import string |
|
| 8 | 5 | import flower_geometry |
| 9 | 1 | |
| 10 | class TestContext( BaseContext ): |
|
| 11 | def OnInit( self ): |
|
| 12 | """Initialisation""" |
|
| 13 | print """Should see flower pattern in gray over white background""" |
|
| 14 | def Render( self, mode = 0): |
|
| 15 | BaseContext.Render( self, mode ) |
|
| 16 | glTranslatef( 0,0,-1) |
|
| 17 | glVertexPointerd( flower_geometry.points_expanded ) |
|
| 18 | glNormalPointerf( flower_geometry.normals_expanded ) |
|
| 19 | glEnableClientState(GL_VERTEX_ARRAY); |
|
| 20 | glEnableClientState(GL_NORMAL_ARRAY); |
|
| 21 | glBegin( GL_TRIANGLES ) |
|
| 22 | for index in range(len(flower_geometry.points_expanded)): |
|
| 23 | glArrayElement( index ) |
|
| 24 | glEnd() |
|
| 25 | ||
| 26 | if __name__ == "__main__": |
|
| 27 | 296 | TestContext.ContextMainLoop() |
Loggerhead 1.10 is a web-based interface for Bazaar branches