XRenderCreatePicture
Russell Shaw
rjshaw at netspace.net.au
Sat Jul 8 22:00:01 PDT 2006
Hi,
XRenderCreatePicture() gives:
(gdb) run
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 153 (RENDER)
Minor opcode of failed request: 4 (RenderCreatePicture)
Serial number of failed request: 16
Current serial number in output stream: 17
Program exited with code 01.
This happens when setting a gdb/ddd breakpoint on "i = 1":
(Xorg 7.0.0 on debian-sid)
#include<stdlib.h>
#include<stdio.h>
#include<X11/Xlib.h>
#include<X11/extensions/Xrender.h>
int
main(int argc, char *argv[])
{
char *displayname = ":0.0";
Display *display = XOpenDisplay(displayname);
XSynchronize(display, 1);
int xrender_eventbase, xrender_errorbase;
if(!XRenderQueryExtension(display, &xrender_eventbase, &xrender_errorbase)) {
printf("Xrender extension is required, but not available.\n");
exit(1);
}
int major = 0;
int minor = 0;
if(!XRenderQueryVersion(display, &major, &minor)) {
printf("Error querying Xrender version.\n");
exit(1);
}
XSetWindowAttributes values;
values.background_pixel = WhitePixel(display, 0);
Window window = XCreateWindow(display, RootWindow(display, 0), 0, 0, 100, 100, 0,
DefaultDepth(display, 0), InputOutput, DefaultVisual(display, 0),
CWBackPixel, &values);
XMapWindow(display, window);
XRenderPictFormat *pictformat = XRenderFindStandardFormat(display, PictStandardARGB32);
XRenderPictureAttributes attributes;
Picture picture = XRenderCreatePicture(display, window, pictformat, 0, &attributes);
int i = 1;
}
More information about the xorg
mailing list