Mercurial > sdl-ios-xcode
annotate src/video/x11/SDL_x11shape.c @ 5004:0c72ae7b7cb2
Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Changed the CAS return value to bool, so it's efficient with OSAtomicCompareAndSwap32Barrier()
Added an atomic test adapted from code by Michael Davidsaver
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 16 Jan 2011 15:16:39 -0800 |
parents | 5624fb0190b5 |
children |
rev | line source |
---|---|
4777
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
1 /* |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
3 Copyright (C) 2010 Eli Gottlieb |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
4 |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
9 |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
14 |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
18 |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
19 Eli Gottlieb |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
20 eligottlieb@gmail.com |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
21 */ |
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
22 |
4845
61cb2d20a46f
Fixing bugs introduced into X11 shaping implementation by merge.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4839
diff
changeset
|
23 #include "SDL_assert.h" |
4794
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
24 #include "SDL_x11video.h" |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4777
diff
changeset
|
25 #include "SDL_x11shape.h" |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4777
diff
changeset
|
26 #include "SDL_x11window.h" |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4777
diff
changeset
|
27 |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
28 SDL_Window* |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
29 X11_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags) { |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
30 return SDL_CreateWindow(title,x,y,w,h,flags); |
4809
329708ffe2a7
Rejiggering the way shaped windows are created as preparation for OS X implementation. Fixed overdrive bug in test program that appears to have been introduced by someone other than myself.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4807
diff
changeset
|
31 } |
329708ffe2a7
Rejiggering the way shaped windows are created as preparation for OS X implementation. Fixed overdrive bug in test program that appears to have been introduced by someone other than myself.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4807
diff
changeset
|
32 |
4845
61cb2d20a46f
Fixing bugs introduced into X11 shaping implementation by merge.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4839
diff
changeset
|
33 SDL_WindowShaper* |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
34 X11_CreateShaper(SDL_Window* window) { |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
35 SDL_WindowShaper* result = NULL; |
4794
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
36 |
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
37 #if SDL_VIDEO_DRIVER_X11_XSHAPE |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
38 if (SDL_X11_HAVE_XSHAPE) { /* Make sure X server supports it. */ |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
39 result = malloc(sizeof(SDL_WindowShaper)); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
40 result->window = window; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
41 result->mode.mode = ShapeModeDefault; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
42 result->mode.parameters.binarizationCutoff = 1; |
4851
5624fb0190b5
Changed flags and positioning (for the fake-hiding) as Andreas recommended.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4846
diff
changeset
|
43 result->userx = result->usery = 0; |
4845
61cb2d20a46f
Fixing bugs introduced into X11 shaping implementation by merge.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4839
diff
changeset
|
44 SDL_ShapeData* data = SDL_malloc(sizeof(SDL_ShapeData)); |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
45 result->driverdata = data; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
46 data->bitmapsize = 0; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
47 data->bitmap = NULL; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
48 window->shaper = result; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
49 int resized_properly = X11_ResizeWindowShape(window); |
4845
61cb2d20a46f
Fixing bugs introduced into X11 shaping implementation by merge.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4839
diff
changeset
|
50 SDL_assert(resized_properly == 0); |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
51 } |
4794
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
52 #endif |
4791
e07cd9e86d7a
Make sure we have XShape symbols before we allow a shaped window.
Ryan C. Gordon <icculus@icculus.org>
parents:
4789
diff
changeset
|
53 |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
54 return result; |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4777
diff
changeset
|
55 } |
4777
6e03d73054d7
Fixed names of driver-specific implementation files.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
diff
changeset
|
56 |
4845
61cb2d20a46f
Fixing bugs introduced into X11 shaping implementation by merge.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4839
diff
changeset
|
57 int |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
58 X11_ResizeWindowShape(SDL_Window* window) { |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
59 SDL_ShapeData* data = window->shaper->driverdata; |
4845
61cb2d20a46f
Fixing bugs introduced into X11 shaping implementation by merge.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4839
diff
changeset
|
60 SDL_assert(data != NULL); |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
61 |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
62 unsigned int bitmapsize = window->w / 8; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
63 if(window->w % 8 > 0) |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
64 bitmapsize += 1; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
65 bitmapsize *= window->h; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
66 if(data->bitmapsize != bitmapsize || data->bitmap == NULL) { |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
67 data->bitmapsize = bitmapsize; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
68 if(data->bitmap != NULL) |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
69 free(data->bitmap); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
70 data->bitmap = malloc(data->bitmapsize); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
71 if(data->bitmap == NULL) { |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
72 SDL_SetError("Could not allocate memory for shaped-window bitmap."); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
73 return -1; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
74 } |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
75 } |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
76 memset(data->bitmap,0,data->bitmapsize); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
77 |
4851
5624fb0190b5
Changed flags and positioning (for the fake-hiding) as Andreas recommended.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4846
diff
changeset
|
78 window->shaper->userx = window->x; |
5624fb0190b5
Changed flags and positioning (for the fake-hiding) as Andreas recommended.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4846
diff
changeset
|
79 window->shaper->usery = window->y; |
5624fb0190b5
Changed flags and positioning (for the fake-hiding) as Andreas recommended.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4846
diff
changeset
|
80 SDL_SetWindowPosition(window,-1000,-1000); |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
81 |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
82 return 0; |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4777
diff
changeset
|
83 } |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
84 |
4845
61cb2d20a46f
Fixing bugs introduced into X11 shaping implementation by merge.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4839
diff
changeset
|
85 int |
4846
4f1573996a65
Fixed a bug in X11 shaping that refused to use color-key mode.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4845
diff
changeset
|
86 X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
87 if(shaper == NULL || shape == NULL || shaper->driverdata == NULL) |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
88 return -1; |
4794
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
89 |
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
90 #if SDL_VIDEO_DRIVER_X11_XSHAPE |
4846
4f1573996a65
Fixed a bug in X11 shaping that refused to use color-key mode.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4845
diff
changeset
|
91 if(shape->format->Amask == 0 && SDL_SHAPEMODEALPHA(shape_mode->mode)) |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
92 return -2; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
93 if(shape->w != shaper->window->w || shape->h != shaper->window->h) |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
94 return -3; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
95 SDL_ShapeData *data = shaper->driverdata; |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
96 |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
97 /* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */ |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
98 SDL_CalculateShapeBitmap(shaper->mode,shape,data->bitmap,8); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
99 |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
100 SDL_WindowData *windowdata = (SDL_WindowData*)(shaper->window->driverdata); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
101 Pixmap shapemask = XCreateBitmapFromData(windowdata->videodata->display,windowdata->xwindow,data->bitmap,shaper->window->w,shaper->window->h); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
102 |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
103 XShapeCombineMask(windowdata->videodata->display,windowdata->xwindow, ShapeBounding, 0, 0,shapemask, ShapeSet); |
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
104 XSync(windowdata->videodata->display,False); |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4777
diff
changeset
|
105 |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
106 XFreePixmap(windowdata->videodata->display,shapemask); |
4794
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
107 #endif |
e562160a873f
Check configure-defined macro before doing _anything_ with XShape.
Ryan C. Gordon <icculus@icculus.org>
parents:
4791
diff
changeset
|
108 |
4838
1f9915666afd
Reformatting code to match the rest of SDL. Variable names seem OK; replaced tabs with 4 spaces each for indentation.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4817
diff
changeset
|
109 return 0; |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4777
diff
changeset
|
110 } |