diff options
author | Guido van Rossum <guido@python.org> | 1993-06-10 14:42:03 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-06-10 14:42:03 (GMT) |
commit | 2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f (patch) | |
tree | b5e7c2abda3aeb88e69286f4833e5611df335432 /Demo/sgi | |
parent | f6d80326973c61bef6f1815b58b95e30b1521aea (diff) | |
download | cpython-2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f.zip cpython-2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f.tar.gz cpython-2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f.tar.bz2 |
Fixed another place where set_rgbmode() should be called.
Separated out colormap installation (for override by Glx widget).
Diffstat (limited to 'Demo/sgi')
-rwxr-xr-x | Demo/sgi/video/VFile.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Demo/sgi/video/VFile.py b/Demo/sgi/video/VFile.py index f04d93b..8e093b8 100755 --- a/Demo/sgi/video/VFile.py +++ b/Demo/sgi/video/VFile.py @@ -449,8 +449,7 @@ class Displayer(VideoParams): # 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 @@ class Displayer(VideoParams): # 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 @@ class Displayer(VideoParams): 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 |