commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8739 - gnuradio/branches/developers/jblum/gr-wxglgui/


From: jblum
Subject: [Commit-gnuradio] r8739 - gnuradio/branches/developers/jblum/gr-wxglgui/src/python
Date: Fri, 27 Jun 2008 11:52:48 -0600 (MDT)

Author: jblum
Date: 2008-06-27 11:52:46 -0600 (Fri, 27 Jun 2008)
New Revision: 8739

Modified:
   gnuradio/branches/developers/jblum/gr-wxglgui/src/python/plotter.py
Log:
on size waits for gl init

Modified: gnuradio/branches/developers/jblum/gr-wxglgui/src/python/plotter.py
===================================================================
--- gnuradio/branches/developers/jblum/gr-wxglgui/src/python/plotter.py 
2008-06-27 17:19:34 UTC (rev 8738)
+++ gnuradio/branches/developers/jblum/gr-wxglgui/src/python/plotter.py 
2008-06-27 17:52:46 UTC (rev 8739)
@@ -57,21 +57,22 @@
                @param parent the parent widgit
                """
                wx.glcanvas.GLCanvas.__init__(self, parent, -1)
+               self._gl_init = False
                wx.EVT_PAINT(self, self.OnPaint)
                wx.EVT_SIZE(self, self.OnSize)
-               self._gl_init = False
 
        def OnSize(self, event):
                """!
                When the window is resized, update the view.
                """
                self.width, self.height = self.GetSize()                
-               glViewport(0, 0, self.width, self.height)
-               glMatrixMode(GL_PROJECTION)
-               glLoadIdentity()
-               glOrtho(0, self.width, self.height, 0, 1, 0)            
-               glMatrixMode(GL_MODELVIEW)
-               glLoadIdentity()
+               if self._gl_init:
+                       glViewport(0, 0, self.width, self.height)
+                       glMatrixMode(GL_PROJECTION)
+                       glLoadIdentity()
+                       glOrtho(0, self.width, self.height, 0, 1, 0)            
+                       glMatrixMode(GL_MODELVIEW)
+                       glLoadIdentity()
                self._changed = True
 
        def OnPaint(self, event):
@@ -79,14 +80,12 @@
                Respond to paint events, call update.
                Initialize GL if this is the first paint event.
                """
-               dc = wx.PaintDC(self)
                self.SetCurrent()
                if not self._gl_init:
-                       glutInit(len(sys.argv), sys.argv)
                        glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)             
                
                        glClearColor(*BACKGROUND_COLOR_SPEC)
-                       self.OnSize(None)
                        self._gl_init = True
+                       self.OnSize(None)
                self.draw()
                return
                





reply via email to

[Prev in Thread] Current Thread [Next in Thread]