comparison src/video/x11/SDL_x11render.c @ 4604:d7535d7a40ea

Integrate XFixes and XDamage into the build system.
author Sunny Sachanandani <sunnysachanandani@gmail.com>
date Mon, 19 Jul 2010 20:05:53 +0530
parents dffa432f0e2b
children 0b3a509c53a0
comparison
equal deleted inserted replaced
4603:dffa432f0e2b 4604:d7535d7a40ea
28 28
29 #include "SDL_x11video.h" 29 #include "SDL_x11video.h"
30 #include "../SDL_rect_c.h" 30 #include "../SDL_rect_c.h"
31 #include "../SDL_pixels_c.h" 31 #include "../SDL_pixels_c.h"
32 #include "../SDL_yuv_sw_c.h" 32 #include "../SDL_yuv_sw_c.h"
33
34 #include <X11/extensions/Xdamage.h>
35 #include <X11/extensions/Xfixes.h>
36
37 #define SDL_VIDEO_DRIVER_X11_XDAMAGE
38 33
39 /* X11 renderer implementation */ 34 /* X11 renderer implementation */
40 35
41 static SDL_Renderer *X11_CreateRenderer(SDL_Window * window, Uint32 flags); 36 static SDL_Renderer *X11_CreateRenderer(SDL_Window * window, Uint32 flags);
42 static int X11_DisplayModeChanged(SDL_Renderer * renderer); 37 static int X11_DisplayModeChanged(SDL_Renderer * renderer);
269 &event_basep, &error_basep) == True) 264 &event_basep, &error_basep) == True)
270 data->use_xrender = SDL_TRUE; 265 data->use_xrender = SDL_TRUE;
271 } 266 }
272 #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE 267 #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
273 if (data->use_xrender) { 268 if (data->use_xrender) {
269 if(SDL_X11_HAVE_XDAMAGE && SDL_X11_HAVE_XFIXES) {
274 /* Query XDamage and XFixes */ 270 /* Query XDamage and XFixes */
275 if(XDamageQueryExtension(data->display, 271 if(XDamageQueryExtension(data->display,
276 &event_basep, 272 &event_basep,
277 &error_basep) == True && 273 &error_basep) == True &&
278 (XFixesQueryExtension(data->display, 274 (XFixesQueryExtension(data->display,
279 &event_basep, 275 &event_basep,
280 &error_basep) == True)) { 276 &error_basep) == True)) {
281 int major_version, minor_version; 277 int major_version, minor_version;
282 XFixesQueryVersion(data->display, 278 XFixesQueryVersion(data->display,
283 &major_version, 279 &major_version,
284 &minor_version); 280 &minor_version);
285 /* Only XFixes v 2 or greater 281 /* Only XFixes v 2 or greater
286 * Required for XFixesSetPictureClipRegion() */ 282 * Required for XFixesSetPictureClipRegion() */
287 if(major_version >= 2) 283 if(major_version >= 2)
288 data->use_xdamage = SDL_TRUE; 284 data->use_xdamage = SDL_TRUE;
285 }
289 } 286 }
290 #endif 287 #endif
291 /* Find the PictFormat from the visual. 288 /* Find the PictFormat from the visual.
292 * Should be an RGB PictFormat most of the time. */ 289 * Should be an RGB PictFormat most of the time. */
293 data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, 290 data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display,