diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-02 15:38:28 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-02 15:38:28 +1000 |
commit | 29d68208a2923905effa15bb93b3c44451861a37 (patch) | |
tree | 0fa3e0f02d27654034a80f50cfeae3ca16148618 | |
parent | 8f762cd276d5afcf0a8f1e3f511f13e2b26fe155 (diff) |
Create a backend pixmap for drawing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | multitouch.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/multitouch.c b/multitouch.c index f15cbeb..d421c27 100644 --- a/multitouch.c +++ b/multitouch.c @@ -20,6 +20,8 @@ struct multitouch { Window win; int xi_opcode; + Pixmap pixmap; + int width; int height; }; @@ -82,6 +84,14 @@ static Window init_window(struct multitouch *mt) return win; } +static Pixmap init_pixmap(struct multitouch *mt) +{ + Pixmap p; + p = XCreatePixmap(mt->dpy, mt->win, mt->width, mt->height, + DefaultDepth(mt->dpy, mt->screen)); + return p; +} + static int init_x11(struct multitouch *mt, int width, int height) { Display *dpy; @@ -107,6 +117,7 @@ static int init_x11(struct multitouch *mt, int width, int height) mt->height = height; mt->win = init_window(mt); + mt->pixmap = init_pixmap(mt); if (!mt->win) return error("Failed to create window.\n"); |