mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-10 11:23:29 +00:00
whatever
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@150 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
14
GNUmakefile
14
GNUmakefile
@@ -53,12 +53,6 @@ WINDOWS = 1
|
||||
|
||||
OPENGL = 1
|
||||
VULKAN = 1
|
||||
else ifeq ($(TARGET),UnixWare)
|
||||
CC = gcc
|
||||
UNIX = 1
|
||||
L_LIBS += -lsocket -lnsl
|
||||
|
||||
NO_XRENDER = 1
|
||||
else ifeq ($(TARGET),SunOS)
|
||||
CC = gcc
|
||||
UNIX = 1
|
||||
@@ -72,13 +66,7 @@ endif
|
||||
ifeq ($(UNIX),1)
|
||||
L_CFLAGS += -DUSE_X11
|
||||
L_OBJS += src/backend/x11.o
|
||||
L_LIBS += -lX11
|
||||
ifeq ($(NO_XRENDER),1)
|
||||
L_CFLAGS += -DNO_XRENDER
|
||||
else
|
||||
L_LIBS += -lXrender
|
||||
endif
|
||||
L_LIBS += -lXext
|
||||
L_LIBS += -lX11 -lXrender -lXext
|
||||
|
||||
GL = -lGL
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
#ifndef NO_XRENDER
|
||||
#include <X11/extensions/Xrender.h>
|
||||
#endif
|
||||
|
||||
struct _MwLL {
|
||||
Display* display;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user