From 01a37dfe1888f1ac6da7ab12c6e4d59ce104d12c Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 14 Feb 2003 08:01:44 +0000 Subject: allocate colors in pseudocolor from the map we allocate in the rendercontrol --- otk/truerendercontrol.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'otk/truerendercontrol.cc') diff --git a/otk/truerendercontrol.cc b/otk/truerendercontrol.cc index 1d5b8dc4..2f1b710e 100644 --- a/otk/truerendercontrol.cc +++ b/otk/truerendercontrol.cc @@ -99,4 +99,14 @@ void TrueRenderControl::reduceDepth(Surface &sf, XImage *im) const } } +void TrueRenderControl::allocateColor(XColor *color) const +{ + const ScreenInfo *info = display->screenInfo(_screen); + if (!XAllocColor(**display, info->colormap(), color)) { + fprintf(stderr, "TrueRenderControl: color alloc error: rgb:%x/%x/%x\n", + color->red & 0xff, color->green & 0xff, color->blue & 0xff); + color->pixel = 0; + } +} + } -- cgit v1.2.3