whatever
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@150 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
d93a8a28c0
commit
e92c02b73d
3 changed files with 2 additions and 26 deletions
14
GNUmakefile
14
GNUmakefile
|
|
@ -53,12 +53,6 @@ WINDOWS = 1
|
||||||
|
|
||||||
OPENGL = 1
|
OPENGL = 1
|
||||||
VULKAN = 1
|
VULKAN = 1
|
||||||
else ifeq ($(TARGET),UnixWare)
|
|
||||||
CC = gcc
|
|
||||||
UNIX = 1
|
|
||||||
L_LIBS += -lsocket -lnsl
|
|
||||||
|
|
||||||
NO_XRENDER = 1
|
|
||||||
else ifeq ($(TARGET),SunOS)
|
else ifeq ($(TARGET),SunOS)
|
||||||
CC = gcc
|
CC = gcc
|
||||||
UNIX = 1
|
UNIX = 1
|
||||||
|
|
@ -72,13 +66,7 @@ endif
|
||||||
ifeq ($(UNIX),1)
|
ifeq ($(UNIX),1)
|
||||||
L_CFLAGS += -DUSE_X11
|
L_CFLAGS += -DUSE_X11
|
||||||
L_OBJS += src/backend/x11.o
|
L_OBJS += src/backend/x11.o
|
||||||
L_LIBS += -lX11
|
L_LIBS += -lX11 -lXrender -lXext
|
||||||
ifeq ($(NO_XRENDER),1)
|
|
||||||
L_CFLAGS += -DNO_XRENDER
|
|
||||||
else
|
|
||||||
L_LIBS += -lXrender
|
|
||||||
endif
|
|
||||||
L_LIBS += -lXext
|
|
||||||
|
|
||||||
GL = -lGL
|
GL = -lGL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/extensions/XShm.h>
|
#include <X11/extensions/XShm.h>
|
||||||
#ifndef NO_XRENDER
|
|
||||||
#include <X11/extensions/Xrender.h>
|
#include <X11/extensions/Xrender.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
struct _MwLL {
|
struct _MwLL {
|
||||||
Display* display;
|
Display* display;
|
||||||
|
|
|
||||||
|
|
@ -206,9 +206,7 @@ MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int hei
|
||||||
MwLLPixmap r = malloc(sizeof(*r));
|
MwLLPixmap r = malloc(sizeof(*r));
|
||||||
char* d = malloc(4 * width * height);
|
char* d = malloc(4 * width * height);
|
||||||
int y, x;
|
int y, x;
|
||||||
#ifndef NO_XRENDER
|
int evbase, erbase;
|
||||||
int evbase, erbase;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
r->width = width;
|
r->width = width;
|
||||||
r->height = height;
|
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->use_shm = XShmQueryExtension(handle->display) ? 1 : 0;
|
||||||
r->data = malloc(width * height * 4);
|
r->data = malloc(width * height * 4);
|
||||||
|
|
||||||
#ifndef NO_XRENDER
|
|
||||||
if(!XRenderQueryExtension(handle->display, &evbase, &erbase)) {
|
if(!XRenderQueryExtension(handle->display, &evbase, &erbase)) {
|
||||||
fprintf(stderr, "XRender missing - cannot proceed pixmap creation\n");
|
fprintf(stderr, "XRender missing - cannot proceed pixmap creation\n");
|
||||||
r->image = NULL;
|
r->image = NULL;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if(r->use_shm) {
|
if(r->use_shm) {
|
||||||
r->image = XShmCreateImage(handle->display, DefaultVisual(handle->display, DefaultScreen(handle->display)), 24, ZPixmap, NULL, &r->shm, width, height);
|
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) {
|
void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||||
#ifdef NO_XRENDER
|
|
||||||
(void)handle;
|
|
||||||
(void)rect;
|
|
||||||
(void)pixmap;
|
|
||||||
#else
|
|
||||||
if(pixmap->image != NULL) {
|
if(pixmap->image != NULL) {
|
||||||
Pixmap px = XCreatePixmap(handle->display, handle->window, pixmap->width, pixmap->height, 24);
|
Pixmap px = XCreatePixmap(handle->display, handle->window, pixmap->width, pixmap->height, 24);
|
||||||
XRenderPictFormat* format = XRenderFindStandardFormat(handle->display, PictStandardRGB24);
|
XRenderPictFormat* format = XRenderFindStandardFormat(handle->display, PictStandardRGB24);
|
||||||
|
|
@ -318,7 +309,6 @@ void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||||
|
|
||||||
XFreePixmap(handle->display, px);
|
XFreePixmap(handle->display, px);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MwLLSetIcon(MwLL handle, MwLLPixmap pixmap) {
|
void MwLLSetIcon(MwLL handle, MwLLPixmap pixmap) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue