From 2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 10 Jun 1993 14:42:03 +0000 Subject: [PATCH] Fixed another place where set_rgbmode() should be called. Separated out colormap installation (for override by Glx widget). --- Demo/sgi/video/VFile.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Demo/sgi/video/VFile.py b/Demo/sgi/video/VFile.py index f04d93b852e..8e093b80cd6 100755 --- a/Demo/sgi/video/VFile.py +++ b/Demo/sgi/video/VFile.py @@ -449,8 +449,7 @@ def initcolormap(self): # This only works on an Entry-level Indigo from IRIX 4.0.5 if self.format == 'rgb8' and is_entry_indigo() and \ gl.gversion() == 'GL4DLG-4.0.': # Note trailing '.'! - gl.RGBmode() - gl.gconfig() + self.set_rgbmode() gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() gl.pixmode(GL.PM_SIZE, 8) @@ -514,6 +513,7 @@ def clearto(self, r, g, b): # by clear() and clearto() def _initcmap(self): + map = [] if self.format in ('mono', 'grey4') and self.mustunpack: convcolor = conv_grey else: @@ -564,12 +564,22 @@ def _initcmap(self): r, g, b = int(rv*255.0), \ int(gv*255.0), \ int(bv*255.0) - gl.mapcolor(index, r, g, b) + map.append(index, r, g, b) if self.color0 == None: self.color0 = \ index, r, g, b + self.install_colormap(map) # Permanently make the first color index current gl.color(self.color0[0]) + + # Install the colormap in the window (may be overridden for Glx window) + + def install_colormap(self, map): + if not self.quiet: + sys.stderr.write(' Installing ' + `len(map)` + \ + ' entries...') + for irgb in map: + gl.mapcolor(irgb) gl.gflush() # send the colormap changes to the X server