From 766a385c831125530ba005735c98c0d3d44a1655 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 11 Jan 2004 12:52:37 +0000 Subject: cleaning, using FbPixmap --- src/FbTk/TextureRender.cc | 130 +++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 70 deletions(-) diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc index f1f1103..669f067 100644 --- a/src/FbTk/TextureRender.cc +++ b/src/FbTk/TextureRender.cc @@ -22,12 +22,14 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: TextureRender.cc,v 1.5 2003/10/02 16:14:41 rathnor Exp $ +// $Id: TextureRender.cc,v 1.6 2004/01/11 12:52:37 fluxgen Exp $ #include "TextureRender.hh" #include "ImageControl.hh" #include "App.hh" +#include "FbPixmap.hh" +#include "GContext.hh" #include #include @@ -114,94 +116,85 @@ Pixmap TextureRender::renderSolid(const FbTk::Texture &texture) { Display *disp = FbTk::App::instance()->display(); - Pixmap pixmap = XCreatePixmap(disp, - RootWindow(disp, control.screenNum()), width, - height, control.depth()); - if (pixmap == None) { + FbPixmap pixmap(RootWindow(disp, control.screenNum()), + width, height, + control.depth()); + + if (pixmap.drawable() == None) { cerr<<"FbTk::TextureRender::render_solid(): error creating pixmap"<display(); - Pixmap pixmap = - XCreatePixmap(disp, - RootWindow(disp, control.screenNum()), width, height, control.depth()); + FbPixmap pixmap(RootWindow(disp, control.screenNum()), + width, height, control.depth()); - if (pixmap == None) { + if (pixmap.drawable() == None) { cerr<<"TextureRender::renderPixmap(): error creating pixmap"<data) { XDestroyImage(image); - XFreePixmap(disp, pixmap); return None; } - XPutImage(disp, pixmap, + XPutImage(disp, pixmap.drawable(), DefaultGC(disp, control.screenNum()), image, 0, 0, 0, 0, width, height); @@ -697,7 +687,7 @@ Pixmap TextureRender::renderPixmap() { XDestroyImage(image); - return pixmap; + return pixmap.release(); } -- cgit v0.11.2