set the background pixmap
This commit is contained in:
parent
5b52a8f561
commit
056c5b435d
3 changed files with 6 additions and 8 deletions
|
@ -67,7 +67,7 @@ public:
|
||||||
|
|
||||||
static RenderControl *getRenderControl(int screen);
|
static RenderControl *getRenderControl(int screen);
|
||||||
|
|
||||||
virtual void render(::Drawable d) = 0;
|
virtual void render(::Window w) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,8 +108,6 @@ void renderPixel(XImage *im, unsigned char *dp, unsigned long pixel)
|
||||||
{
|
{
|
||||||
unsigned int bpp = im->bits_per_pixel + (im->byte_order == MSBFirst) ? 1 : 0;
|
unsigned int bpp = im->bits_per_pixel + (im->byte_order == MSBFirst) ? 1 : 0;
|
||||||
|
|
||||||
printf("%lx \n", pixel);
|
|
||||||
|
|
||||||
switch (bpp) {
|
switch (bpp) {
|
||||||
case 8: // 8bpp
|
case 8: // 8bpp
|
||||||
*dp++ = pixel;
|
*dp++ = pixel;
|
||||||
|
@ -147,13 +145,13 @@ void renderPixel(XImage *im, unsigned char *dp, unsigned long pixel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrueRenderControl::render(::Drawable d)
|
void TrueRenderControl::render(::Window win)
|
||||||
{
|
{
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
gcv.cap_style = CapProjecting;
|
gcv.cap_style = CapProjecting;
|
||||||
|
|
||||||
int w = 255, h = 32;
|
int w = 255, h = 32;
|
||||||
Pixmap p = XCreatePixmap(**display, d, w, h, _screen->depth());
|
Pixmap p = XCreatePixmap(**display, win, w, h, _screen->depth());
|
||||||
XImage *im = XCreateImage(**display, _screen->visual(), _screen->depth(),
|
XImage *im = XCreateImage(**display, _screen->visual(), _screen->depth(),
|
||||||
ZPixmap, 0, NULL, w, h, 32, 0);
|
ZPixmap, 0, NULL, w, h, 32, 0);
|
||||||
//GC gc = XCreateGC(**display, _screen->rootWindow(), GCCapStyle, &gcv);
|
//GC gc = XCreateGC(**display, _screen->rootWindow(), GCCapStyle, &gcv);
|
||||||
|
@ -187,8 +185,8 @@ void TrueRenderControl::render(::Drawable d)
|
||||||
//image->data = NULL;
|
//image->data = NULL;
|
||||||
XDestroyImage(im);
|
XDestroyImage(im);
|
||||||
|
|
||||||
XCopyArea(**display, p, d, DefaultGC(**display, _screen->screen()),
|
XSetWindowBackgroundPixmap(**display, win, p);
|
||||||
0, 0, w, h, 0, 0);
|
XClearWindow(**display, win);
|
||||||
|
|
||||||
XFreePixmap(**display, p);
|
XFreePixmap(**display, p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ public:
|
||||||
TrueRenderControl(const ScreenInfo *screen);
|
TrueRenderControl(const ScreenInfo *screen);
|
||||||
virtual ~TrueRenderControl();
|
virtual ~TrueRenderControl();
|
||||||
|
|
||||||
virtual void render(::Drawable d);
|
virtual void render(::Window w);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue