X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fx11.h;h=a4a0577fd1402dab9d3823c7f18e90d0a459556b;hb=de8b3ae622eae10f1caf96872fb1790f7bd9644b;hp=c42f25cc54fe4d896277a192c5348b01351e2d2f;hpb=c9433eab5c4317ed4f89164b386a7d33562e29be;p=rocksndiamonds.git diff --git a/src/libgame/x11.h b/src/libgame/x11.h index c42f25cc..a4a0577f 100644 --- a/src/libgame/x11.h +++ b/src/libgame/x11.h @@ -34,6 +34,15 @@ #define TARGET_STRING "X11" #endif +#if defined(PLATFORM_UNIX) +/* This triggers some stuff that is needed because X11 (XSetClipOrigin(), + to be precise) is often very slow when preparing a masked XCopyArea() + for big Pixmaps. + To prevent this, small (tile-sized) mask Pixmaps are created which will + then be set much faster with XSetClipOrigin() and speed things up a lot. */ +#define TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND +#endif + #define FULLSCREEN_STATUS FULLSCREEN_NOT_AVAILABLE @@ -42,7 +51,8 @@ typedef struct X11DrawableInfo Bitmap; typedef struct X11DrawableInfo DrawWindow; typedef struct X11DrawableInfo DrawBuffer; -/* "Pixel" is already defined in X11/Intrinsic.h */ +/* "Pixel" is already defined */ +/* "Cursor" is already defined */ typedef KeySym Key; @@ -78,6 +88,9 @@ struct XY /* X11 symbol definitions */ +#define BLACK_PIXEL BlackPixel(display, screen) +#define WHITE_PIXEL WhitePixel(display, screen) + #define EVENT_BUTTONPRESS ButtonPress #define EVENT_BUTTONRELEASE ButtonRelease #define EVENT_MOTIONNOTIFY MotionNotify @@ -295,6 +308,20 @@ struct XY inline void X11InitVideoDisplay(void); inline void X11InitVideoBuffer(DrawBuffer **, DrawWindow **); + +void X11ZoomBitmap(Bitmap *, Bitmap *); Bitmap *X11LoadImage(char *); +inline void X11CreateBitmapContent(Bitmap *, int, int, int); +inline void X11FreeBitmapPointers(Bitmap *); +inline void X11CopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int); +inline void X11FillRectangle(Bitmap *, int, int, int, int, Pixel); +inline void X11DrawSimpleLine(Bitmap *, int, int, int, int, Pixel); +inline Pixel X11GetPixel(Bitmap *, int, int); +inline Pixel X11GetPixelFromRGB(unsigned int, unsigned int, unsigned int); + +#if defined(TARGET_X11_NATIVE) +void X11SetMouseCursor(const char **); +#endif + #endif /* X11_H */