Permalink
Browse files

Revert "Cleanup: Remove extra glFlush calls from a few places."

This reverts commit a897844.

Ought to fix issue #250
  • Loading branch information...
codewarrior0 committed Jan 17, 2013
1 parent f57018f commit 4680add658f8940e48a22d362db5fe34fbebc15d
Showing with 7 additions and 5 deletions.
  1. +6 −5 albow/tab_panel.py
  2. +1 −0 albow/widget.py
View
@@ -157,7 +157,7 @@ def tab_number_containing_x(self, x):
i = (x - m) * n // width
if 0 <= i < n:
return i
-
+
def gl_draw_self(self, root, offset):
self.gl_draw(root, offset)
@@ -166,7 +166,7 @@ def gl_draw(self, root, offset):
if len(pages) > 1:
tlcorner = (offset[0] + self.bottomleft[0], offset[1] + self.bottomleft[1])
- pageTabContents = []
+ pageTabContents = []
current_page = self.current_page
n = len(pages)
b = self.tab_border_width
@@ -182,7 +182,7 @@ def gl_draw(self, root, offset):
surface = Surface(self.size, SRCALPHA)
glEnable(GL_BLEND)
-
+
for i, page in enumerate(pages):
x1 = x0+tabWidth
selected = page is current_page
@@ -197,8 +197,8 @@ def gl_draw(self, root, offset):
offs = ((tabWidth - r.size[0])/2) + m +((s+tabWidth)*i)
surface.blit(buf, (offs, m))
- x0 = x1 + s
-
+ x0 = x1 + s
+
data = image.tostring(surface, 'RGBA', 1)
rect = self.rect.move(offset)
w, h = root.size
@@ -214,5 +214,6 @@ def gl_draw(self, root, offset):
glDrawPixels(self.width, self.height,
GL_RGBA, GL_UNSIGNED_BYTE, fromstring(data, dtype='uint8'))
glPopAttrib()
+ glFlush()
glDisable(GL_BLEND)
View
@@ -750,6 +750,7 @@ def gl_draw_all(self, root, offset):
GL.glDrawPixels(self.width, self.height,
GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, fromstring(data, dtype='uint8'))
GL.glPopAttrib()
+ GL.glFlush()
def gl_draw_self(self, root, offset):
pass

0 comments on commit 4680add

Please sign in to comment.