summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Osgood <iano@quirkster.com>2008-03-16 16:30:42 -0700
committerIan Osgood <iano@quirkster.com>2008-03-16 16:30:42 -0700
commitb5560bb7700a7faff1fb534b97fee054d8031f36 (patch)
treeeef71b19f0ad650956faaad641418ceb8f4d711a
parenta1736e6a47325317b4988b1a9acc97fb718380a6 (diff)
Update demo/tests for Bart's modified xcb-image util library.
Only julia works; flames fails with a bus error and lissajoux 0 and 1 both fail on xcb_image_create_native.
-rw-r--r--tests/flames.c3
-rw-r--r--tests/julia.c3
-rw-r--r--tests/lissajoux.c11
3 files changed, 9 insertions, 8 deletions
diff --git a/tests/flames.c b/tests/flames.c
index fba49c5..ba594ac 100644
--- a/tests/flames.c
+++ b/tests/flames.c
@@ -29,6 +29,7 @@
#include <xcb/shm.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_image.h>
+#define XCB_ALL_PLANES ~0
#include <xcb/xcb_icccm.h>
/* some defines for the flame */
@@ -325,7 +326,7 @@ flame_draw_flame (flame *f)
}
}
xcb_image_put (f->xcb.c, f->xcb.draw, f->xcb.gc, image,
- 0, 0, 0, 0, BG_W, BG_H);
+ 0, 0, 0);
xcb_image_destroy (image);
}
diff --git a/tests/julia.c b/tests/julia.c
index 7f184b7..882cbc4 100644
--- a/tests/julia.c
+++ b/tests/julia.c
@@ -5,6 +5,7 @@
#include <xcb/shm.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_image.h>
+#define XCB_ALL_PLANES ~0
#include "julia.h"
@@ -107,7 +108,7 @@ draw_julia (Data *datap)
}
xcb_image_put (datap->conn, datap->draw, datap->gc, datap->image,
- 0, 0, 0, 0, W_W, W_H);
+ 0, 0, 0);
}
int
diff --git a/tests/lissajoux.c b/tests/lissajoux.c
index 052d2de..2fa4378 100644
--- a/tests/lissajoux.c
+++ b/tests/lissajoux.c
@@ -12,6 +12,7 @@
#include <xcb/shm.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_image.h>
+#define XCB_ALL_PLANES ~0
#include "lissajoux.h"
@@ -99,7 +100,7 @@ draw_lissajoux (Data *datap)
else
{
xcb_image_put (datap->conn, datap->draw, datap->gc, datap->image,
- 0, 0, 0, 0, W_W, W_H);
+ 0, 0, 0);
xcb_image_destroy (datap->image);
}
}
@@ -119,8 +120,6 @@ step (Data *datap)
printf("FRAME COUNT..: %i frames\n", loop_count);
printf("TIME.........: %3.3f seconds\n", t);
printf("AVERAGE FPS..: %3.3f fps\n", (double)loop_count / t);
- if (do_shm)
- xcb_image_shm_destroy (datap->image);
xcb_disconnect (datap->conn);
exit(0);
}
@@ -145,12 +144,12 @@ shm_test (Data *datap)
format = rep->pixmap_format;
else
format = 0;
- datap->image = xcb_image_shm_create (datap->conn, datap->depth,
- format, NULL, W_W, W_H);
+ datap->image = xcb_image_create_native (datap->conn, W_W, W_H,
+ format, datap->depth, NULL, ~0, NULL);
assert(datap->image);
shminfo.shmid = shmget (IPC_PRIVATE,
- datap->image->bytes_per_line*datap->image->height,
+ datap->image->stride*datap->image->height,
IPC_CREAT | 0777);
assert(shminfo.shmid != -1);
shminfo.shmaddr = shmat (shminfo.shmid, 0, 0);