Integrate XFixes and XDamage into the build system.
This commit is contained in:
parent
7739189255
commit
4ded0f623c
5 changed files with 85 additions and 22 deletions
|
@ -56,6 +56,14 @@
|
|||
#include <X11/extensions/Xrender.h>
|
||||
#endif
|
||||
|
||||
#if SDL_VIDEO_DRIVER_X11_XDAMAGE
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#endif
|
||||
|
||||
#if SDL_VIDEO_DRIVER_X11_XFIXES
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When using the "dynamic X11" functionality, we duplicate all the Xlib
|
||||
* symbols that would be referenced by SDL inside of SDL itself.
|
||||
|
|
|
@ -31,11 +31,6 @@
|
|||
#include "../SDL_pixels_c.h"
|
||||
#include "../SDL_yuv_sw_c.h"
|
||||
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#define SDL_VIDEO_DRIVER_X11_XDAMAGE
|
||||
|
||||
/* X11 renderer implementation */
|
||||
|
||||
static SDL_Renderer *X11_CreateRenderer(SDL_Window * window, Uint32 flags);
|
||||
|
@ -271,21 +266,23 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||
}
|
||||
#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
|
||||
if (data->use_xrender) {
|
||||
if(SDL_X11_HAVE_XDAMAGE && SDL_X11_HAVE_XFIXES) {
|
||||
/* Query XDamage and XFixes */
|
||||
if(XDamageQueryExtension(data->display,
|
||||
&event_basep,
|
||||
&error_basep) == True &&
|
||||
(XFixesQueryExtension(data->display,
|
||||
&event_basep,
|
||||
&error_basep) == True)) {
|
||||
int major_version, minor_version;
|
||||
XFixesQueryVersion(data->display,
|
||||
&major_version,
|
||||
&minor_version);
|
||||
/* Only XFixes v 2 or greater
|
||||
* Required for XFixesSetPictureClipRegion() */
|
||||
if(major_version >= 2)
|
||||
data->use_xdamage = SDL_TRUE;
|
||||
if(XDamageQueryExtension(data->display,
|
||||
&event_basep,
|
||||
&error_basep) == True &&
|
||||
(XFixesQueryExtension(data->display,
|
||||
&event_basep,
|
||||
&error_basep) == True)) {
|
||||
int major_version, minor_version;
|
||||
XFixesQueryVersion(data->display,
|
||||
&major_version,
|
||||
&minor_version);
|
||||
/* Only XFixes v 2 or greater
|
||||
* Required for XFixesSetPictureClipRegion() */
|
||||
if(major_version >= 2)
|
||||
data->use_xdamage = SDL_TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Find the PictFormat from the visual.
|
||||
|
|
|
@ -252,6 +252,22 @@ SDL_X11_SYM(void,XRenderSetPictureTransform,(Display *dpy,Picture picture,XTrans
|
|||
SDL_X11_SYM(void,XRenderFillRectangle,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,int x,int y,unsigned int width,unsigned int height),(dpy,op,dst,color,x,y,width,height),return)
|
||||
SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,_Xconst XRectangle *rectangles,int n_rects),(dpy,op,dst,color,rectangles,n_rects),return)
|
||||
#endif
|
||||
|
||||
#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
|
||||
SDL_X11_MODULE(XDAMAGE)
|
||||
SDL_X11_SYM(Bool,XDamageQueryExtension,(Display *dpy,int *event_base_return,int *error_base_return),(dpy,event_base_return,error_base_return),return)
|
||||
SDL_X11_SYM(Damage,XDamageCreate,(Display *dpy,Drawable d,int level),(dpy,d,level),return)
|
||||
SDL_X11_SYM(void,XDamageSubtract,(Display *dpy,Damage damage,XserverRegion repair,XserverRegion parts),(dpy,damage,repair,parts),return)
|
||||
SDL_X11_SYM(void,XDamageDestroy,(Display *dpy,Damage damage),(dpy,damage),return)
|
||||
#endif
|
||||
|
||||
#ifdef SDL_VIDEO_DRIVER_X11_XFIXES
|
||||
SDL_X11_MODULE(XFIXES)
|
||||
SDL_X11_SYM(Bool,XFixesQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return)
|
||||
SDL_X11_SYM(Status,XFixesQueryVersion,(Display *dpy,int *major,int *minor),(dpy,major,minor),return)
|
||||
SDL_X11_SYM(void,XFixesSetGCClipRegion,(Display *dpy,GC gc,int clip_x,int clip_y,XserverRegion region),(dpy,gc,clip_x,clip_y,region),return)
|
||||
SDL_X11_SYM(void,XFixesSetPictureClipRegion,(Display *dpy,XID picture,int clip_x,int clip_y,XserverRegion region),(dpy,picture,clip_x,clip_y,region),return)
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue