From: Diane Trout Date: Thu, 27 Jul 2006 01:24:46 +0000 (+0000) Subject: update gl.py glut example code X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=eb48ed626cd0d36f2fbd2e43ea2a66c6f4f01404 update gl.py glut example code --- diff --git a/py/gl.py b/py/gl.py index a9d675b..450b1bd 100644 --- a/py/gl.py +++ b/py/gl.py @@ -9,11 +9,16 @@ import mussa class pyMussaGL: def __init__(self): + """Initalize our data and our glut window""" + # make up a simple sequence self.s = "AAGGCCTT" * 5 self.seq = mussa.Sequence(self.s) - self.glseq = mussa.GlSequence(self.seq) - print self.glseq.width + # AnnotationColors is required, even though it'd be nice + # if it were optional + self.glseq = mussa.GlSequence(self.seq, mussa.AnnotationColors()) + assert len(self.s) == self.glseq.length + # set up opengl buffer glutInit(sys.argv) glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH ) glutCreateWindow('mussa') @@ -25,6 +30,7 @@ class pyMussaGL: print "init done" def display(self): + """Update showing buffer""" glClear(GL_COLOR_BUFFER_BIT) self.glseq.draw(-50, self.glseq.width+50) #glutSwapBuffers()