Logo Search packages:      
Sourcecode: fbdesk version File versions  Download package

Pixmap FbTk::TextureRender::renderPixmap (  )  [private]

Render to pixmap

Returns:
rendered pixmap

Definition at line 651 of file TextureRender.cc.

References FbTk::ImageControl::depth(), FbTk::App::display(), FbTk::App::instance(), renderXImage(), and FbTk::ImageControl::screenNum().

Referenced by renderGradient().

                                   {
    Display *disp = FbTk::App::instance()->display();
    Pixmap pixmap =
        XCreatePixmap(disp,
                      RootWindow(disp, control.screenNum()), width, height, control.depth());

    if (pixmap == None) {
        cerr<<"TextureRender::renderPixmap(): error creating pixmap"<<endl;
        return None;
    }

    XImage *image = renderXImage();

    if (! image) {
        XFreePixmap(disp, pixmap);
        return None;
    } else if (! image->data) {
        XDestroyImage(image);
        XFreePixmap(disp, pixmap);
        return None;
    }

    XPutImage(disp, pixmap,
              DefaultGC(disp, control.screenNum()),
              image, 0, 0, 0, 0, width, height);

    if (image->data != 0) {
        delete [] image->data;
        image->data = 0;
    }

    XDestroyImage(image);

    return pixmap;
}


Generated by  Doxygen 1.6.0   Back to index