comparison src/video/SDL_sysvideo.h @ 4782:b6930aefd008

Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
author Eli Gottlieb <eligottlieb@gmail.com>
date Wed, 30 Jun 2010 16:19:44 -0400
parents fb905d5674cc
children c9eb95f29770
comparison
equal deleted inserted replaced
4781:fc4c775b468a 4782:b6930aefd008
24 #ifndef _SDL_sysvideo_h 24 #ifndef _SDL_sysvideo_h
25 #define _SDL_sysvideo_h 25 #define _SDL_sysvideo_h
26 26
27 #include "SDL_mouse.h" 27 #include "SDL_mouse.h"
28 #include "SDL_keysym.h" 28 #include "SDL_keysym.h"
29 #include "SDL_shape.h"
29 30
30 /* The SDL video driver */ 31 /* The SDL video driver */
31 32
32 typedef struct SDL_Renderer SDL_Renderer; 33 typedef struct SDL_Renderer SDL_Renderer;
33 typedef struct SDL_RenderDriver SDL_RenderDriver; 34 typedef struct SDL_RenderDriver SDL_RenderDriver;
35 typedef struct SDL_WindowShaper SDL_WindowShaper;
36 typedef struct SDL_ShapeDriver SDL_ShapeDriver;
34 typedef struct SDL_VideoDisplay SDL_VideoDisplay; 37 typedef struct SDL_VideoDisplay SDL_VideoDisplay;
35 typedef struct SDL_VideoDevice SDL_VideoDevice; 38 typedef struct SDL_VideoDevice SDL_VideoDevice;
36 39
37 /* Define the SDL texture structure */ 40 /* Define the SDL texture structure */
38 struct SDL_Texture 41 struct SDL_Texture
95 int count); 98 int count);
96 int (*RenderDrawRects) (SDL_Renderer * renderer, const SDL_Rect ** rects, 99 int (*RenderDrawRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
97 int count); 100 int count);
98 int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects, 101 int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
99 int count); 102 int count);
100 int (*RenderDrawEllipse) (SDL_Renderer * renderer, int x, int y,
101 int w, int h);
102 int (*RenderFillEllipse) (SDL_Renderer * renderer, int x, int y,
103 int w, int h);
104 int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture, 103 int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
105 const SDL_Rect * srcrect, const SDL_Rect * dstrect); 104 const SDL_Rect * srcrect, const SDL_Rect * dstrect);
106 int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect, 105 int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
107 Uint32 format, void * pixels, int pitch); 106 Uint32 format, void * pixels, int pitch);
108 int (*RenderWritePixels) (SDL_Renderer * renderer, const SDL_Rect * rect, 107 int (*RenderWritePixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
134 133
135 /* Info about the renderer capabilities */ 134 /* Info about the renderer capabilities */
136 SDL_RendererInfo info; 135 SDL_RendererInfo info;
137 }; 136 };
138 137
138 /* Define the SDL window-shaper structure */
139 struct SDL_WindowShaper
140 {
141 /* The window associated with the shaper */
142 SDL_Window *window;
143
144 /* The user's specified SDL_WINDOW_SHOWN flag, for use once the user gives the window a shape. */
145 Uint32 usershownflag;
146
147 /* The cutoff value for alpha-channel binarization. When alpha is greater-than-or-equal-to this value in the shape
148 image, the corresponding pixel of the actual window will be considered part of the window's shape. */
149 Uint8 alphacutoff;
150
151 /* Has this window been assigned a shape? */
152 SDL_bool hasshape;
153
154 void *driverdata;
155 };
156
157 /* Define the SDL shape driver structure */
158 struct SDL_ShapeDriver
159 {
160 SDL_WindowShaper *(*CreateShaper)(SDL_Window * window);
161 int (*SetWindowShape)(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode);
162 int (*ResizeWindowShape)(SDL_Window *window);
163 };
164
139 /* Define the SDL window structure, corresponding to toplevel windows */ 165 /* Define the SDL window structure, corresponding to toplevel windows */
140 struct SDL_Window 166 struct SDL_Window
141 { 167 {
142 const void *magic; 168 const void *magic;
143 Uint32 id; 169 Uint32 id;
148 174
149 SDL_VideoDisplay *display; 175 SDL_VideoDisplay *display;
150 SDL_Renderer *renderer; 176 SDL_Renderer *renderer;
151 177
152 SDL_DisplayMode fullscreen_mode; 178 SDL_DisplayMode fullscreen_mode;
179
180 SDL_WindowShaper *shaper;
153 181
154 void *userdata; 182 void *userdata;
155 void *driverdata; 183 void *driverdata;
156 184
157 SDL_Window *prev; 185 SDL_Window *prev;
268 void (*MaximizeWindow) (_THIS, SDL_Window * window); 296 void (*MaximizeWindow) (_THIS, SDL_Window * window);
269 void (*MinimizeWindow) (_THIS, SDL_Window * window); 297 void (*MinimizeWindow) (_THIS, SDL_Window * window);
270 void (*RestoreWindow) (_THIS, SDL_Window * window); 298 void (*RestoreWindow) (_THIS, SDL_Window * window);
271 void (*SetWindowGrab) (_THIS, SDL_Window * window); 299 void (*SetWindowGrab) (_THIS, SDL_Window * window);
272 void (*DestroyWindow) (_THIS, SDL_Window * window); 300 void (*DestroyWindow) (_THIS, SDL_Window * window);
301
302 /* * * */
303 /*
304 * Shaped-window functions
305 */
306 SDL_ShapeDriver shape_driver;
273 307
274 /* Get some platform dependent window information */ 308 /* Get some platform dependent window information */
275 SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window, 309 SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,
276 struct SDL_SysWMinfo * info); 310 struct SDL_SysWMinfo * info);
277 311