-void TrueRenderControl::drawBackground(Surface *sf,
- const RenderTexture &texture) const
-{
- assert(sf);
-
- int w = sf->width(), h = sf->height();
-
- XImage *im = XCreateImage(**display, _screen->visual(), _screen->depth(),
- ZPixmap, 0, NULL, w, h, 32, 0);
-
- unsigned char *data = new unsigned char[im->bytes_per_line * h];
- unsigned char *dp = data;
-
- for (int y = 0; y < h/3; ++y)
- for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
- renderPixel(im, dp, _red_color_table[255*x/w] << _red_offset);
- for (int y = 0; y < h/3; ++y)
- for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
- renderPixel(im, dp, _green_color_table[255*x/w] << _green_offset);
- for (int y = 0; y < h/3; ++y)
- for (int x = 0; x < w; ++x, dp += im->bits_per_pixel/8)
- renderPixel(im, dp, _blue_color_table[255*x/w] << _blue_offset);
-
- printf("\nDone %d %d\n", im->bytes_per_line * h, dp - data);
-
- im->data = (char*) data;
-
- if (!sf->_pm)
- sf->_pm = XCreatePixmap(**display, _screen->rootWindow(), w, h,
- _screen->depth());
- XPutImage(**display, sf->_pm, DefaultGC(**display, _screen->screen()),
- im, 0, 0, 0, 0, w, h);
-
- //delete [] image->data;
- //image->data = NULL;
- XDestroyImage(im);
-}
-