Finished X11 shaped-window functionality and removed ellipse+polygon rendering.

This commit is contained in:
Eli Gottlieb 2010-06-30 16:19:44 -04:00
parent 2c8b1ce8f7
commit ea29eee83c
9 changed files with 193 additions and 125 deletions

View file

@ -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 @@ struct SDL_Renderer
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 @@ struct SDL_RenderDriver
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 @@ struct SDL_Window
SDL_Renderer *renderer;
SDL_DisplayMode fullscreen_mode;
SDL_WindowShaper *shaper;
void *userdata;
void *driverdata;
@ -270,6 +298,12 @@ struct SDL_VideoDevice
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,