Mercurial > sdl-ios-xcode
diff 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 |
line wrap: on
line diff
--- a/src/video/SDL_sysvideo.h Mon Jun 21 23:08:10 2010 -0400 +++ b/src/video/SDL_sysvideo.h Wed Jun 30 16:19:44 2010 -0400 @@ -26,11 +26,14 @@ #include "SDL_mouse.h" #include "SDL_keysym.h" +#include "SDL_shape.h" /* The SDL video driver */ typedef struct SDL_Renderer SDL_Renderer; typedef struct SDL_RenderDriver SDL_RenderDriver; +typedef struct SDL_WindowShaper SDL_WindowShaper; +typedef struct SDL_ShapeDriver SDL_ShapeDriver; typedef struct SDL_VideoDisplay SDL_VideoDisplay; typedef struct SDL_VideoDevice SDL_VideoDevice; @@ -97,10 +100,6 @@ int count); int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects, int count); - int (*RenderDrawEllipse) (SDL_Renderer * renderer, int x, int y, - int w, int h); - int (*RenderFillEllipse) (SDL_Renderer * renderer, int x, int y, - int w, int h); int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_Rect * dstrect); int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect, @@ -136,6 +135,33 @@ SDL_RendererInfo info; }; +/* Define the SDL window-shaper structure */ +struct SDL_WindowShaper +{ + /* The window associated with the shaper */ + SDL_Window *window; + + /* The user's specified SDL_WINDOW_SHOWN flag, for use once the user gives the window a shape. */ + Uint32 usershownflag; + + /* The cutoff value for alpha-channel binarization. When alpha is greater-than-or-equal-to this value in the shape + image, the corresponding pixel of the actual window will be considered part of the window's shape. */ + Uint8 alphacutoff; + + /* Has this window been assigned a shape? */ + SDL_bool hasshape; + + void *driverdata; +}; + +/* Define the SDL shape driver structure */ +struct SDL_ShapeDriver +{ + SDL_WindowShaper *(*CreateShaper)(SDL_Window * window); + int (*SetWindowShape)(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode); + int (*ResizeWindowShape)(SDL_Window *window); +}; + /* Define the SDL window structure, corresponding to toplevel windows */ struct SDL_Window { @@ -150,6 +176,8 @@ SDL_Renderer *renderer; SDL_DisplayMode fullscreen_mode; + + SDL_WindowShaper *shaper; void *userdata; void *driverdata; @@ -270,6 +298,12 @@ void (*RestoreWindow) (_THIS, SDL_Window * window); void (*SetWindowGrab) (_THIS, SDL_Window * window); void (*DestroyWindow) (_THIS, SDL_Window * window); + + /* * * */ + /* + * Shaped-window functions + */ + SDL_ShapeDriver shape_driver; /* Get some platform dependent window information */ SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,