1 """Can we show a mussa gl object?
5 from OpenGL.GLUT import *
6 from OpenGL.GL import *
12 """Initalize our data and our glut window"""
13 # make up a simple sequence
14 self.s = "AAGGCCTT" * 5
15 self.seq = mussa.Sequence(self.s)
18 annot = mussa.annot(0, 5, "name", "type")
19 self.seq.add_annotation(annot)
21 # AnnotationColors is required, even though it'd be nice
23 self.glseq = mussa.GlSequence(self.seq, mussa.AnnotationColors())
24 assert len(self.s) == self.glseq.size
26 # set up opengl buffer
28 glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH )
29 glutCreateWindow('mussa')
32 glOrtho(-10, len(self.s)+10, -50, 50, -50, 50)
34 glutDisplayFunc(self.display)
38 """Update showing buffer"""
39 glClear(GL_COLOR_BUFFER_BIT)
40 self.glseq.draw(-50, self.glseq.size+50)
43 if __name__ == "__main__":