git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@150 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-04 04:15:30 +00:00
parent d93a8a28c0
commit e92c02b73d
3 changed files with 2 additions and 26 deletions

View File

@@ -206,9 +206,7 @@ MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int hei
MwLLPixmap r = malloc(sizeof(*r));
char* d = malloc(4 * width * height);
int y, x;
#ifndef NO_XRENDER
int evbase, erbase;
#endif
int evbase, erbase;
r->width = width;
r->height = height;
@@ -216,13 +214,11 @@ MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int hei
r->use_shm = XShmQueryExtension(handle->display) ? 1 : 0;
r->data = malloc(width * height * 4);
#ifndef NO_XRENDER
if(!XRenderQueryExtension(handle->display, &evbase, &erbase)) {
fprintf(stderr, "XRender missing - cannot proceed pixmap creation\n");
r->image = NULL;
return r;
}
#endif
if(r->use_shm) {
r->image = XShmCreateImage(handle->display, DefaultVisual(handle->display, DefaultScreen(handle->display)), 24, ZPixmap, NULL, &r->shm, width, height);
@@ -273,11 +269,6 @@ void MwLLDestroyPixmap(MwLLPixmap pixmap) {
}
void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
#ifdef NO_XRENDER
(void)handle;
(void)rect;
(void)pixmap;
#else
if(pixmap->image != NULL) {
Pixmap px = XCreatePixmap(handle->display, handle->window, pixmap->width, pixmap->height, 24);
XRenderPictFormat* format = XRenderFindStandardFormat(handle->display, PictStandardRGB24);
@@ -318,7 +309,6 @@ void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
XFreePixmap(handle->display, px);
}
#endif
}
void MwLLSetIcon(MwLL handle, MwLLPixmap pixmap) {