Mercurial > sdl-ios-xcode
comparison include/SDL_shape.h @ 4778:9838d3525a1b
Stubbed out the new get/set parameter functions, added the start of the enum, union, and struct for those parameters themselves, and added doxygen comments throughout the SDL_shape.h header.
author | Eli Gottlieb <eligottlieb@gmail.com> |
---|---|
date | Thu, 10 Jun 2010 17:37:19 -0400 |
parents | 29dcad9c58b3 |
children | bb179250fcb3 |
comparison
equal
deleted
inserted
replaced
4777:6e03d73054d7 | 4778:9838d3525a1b |
---|---|
57 * | 57 * |
58 * \sa SDL_DestroyWindow() | 58 * \sa SDL_DestroyWindow() |
59 */ | 59 */ |
60 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); | 60 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); |
61 | 61 |
62 /** | |
63 * \brief Return whether the given window is a shaped window. | |
64 * | |
65 * \param window The window to query for being shaped. | |
66 * | |
67 * \return SDL_TRUE if the window is a shaped window and SDL_FALSE otherwise. | |
68 * \sa SDL_CreateShapedWindow | |
69 */ | |
62 extern DECLSPEC SDL_bool SDLCALL SDL_WindowIsShaped(const SDL_Window *window); | 70 extern DECLSPEC SDL_bool SDLCALL SDL_WindowIsShaped(const SDL_Window *window); |
71 | |
72 /** | |
73 * \brief Select the shape of a given window as a rendering target. | |
74 * | |
75 * \param window The window whose shape should become the current rendering target. | |
76 * | |
77 * \return 0 on success, -1 if something other than a valid shaped window is passed into \c window. | |
78 * | |
79 * The shape of the window given in \c window is selected as the new render target, and in the default mode (see | |
80 * SDL_WindowShapeParams) the alpha channel of that render target determines which pixels of the window are part of its | |
81 * visible shape and which are not according to a cutoff value. All normal SDL rendering functions can be used on it, | |
82 * and its own specific parameters can be examined and set with SDL_GetShapeParameters() and SDL_SetShapeParameters(). | |
83 * The final shape will be computed and the actual appearance of the window changed only upon a call to | |
84 * SDL_RenderPresent(). | |
85 * | |
86 * \sa SDL_GetShapeParameters | |
87 * \sa SDL_SetShapeParameters | |
88 * \sa SDL_RenderPresent | |
89 */ | |
63 extern DECLSPEC int SDLCALL SDL_SelectShapeRenderer(const SDL_Window *window); | 90 extern DECLSPEC int SDLCALL SDL_SelectShapeRenderer(const SDL_Window *window); |
91 | |
92 /** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ | |
93 typedef enum {ShapeModeDefault, ShapeModeBinarizeAlpha} WindowShapeMode; | |
94 /** \brief A union containing parameters for shaped windows. */ | |
95 typedef union { | |
96 /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */ | |
97 Uint8 binarizationCutoff; | |
98 } SDL_WindowShapeParams; | |
99 | |
100 /** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ | |
101 typedef struct SDL_WindowShapeMode { | |
102 WindowShapeMode mode; | |
103 SDL_WindowShapeParams parameters; | |
104 } SDL_WindowShapeMode; | |
105 | |
106 /** | |
107 * \brief Set the shape parameters of a shaped window. | |
108 * | |
109 * \param window The shaped window whose parameters should be set. | |
110 * \param shapeMode The parameters to set for the shaped window. | |
111 * | |
112 * \return 0 on success, -1 on invalid parameters in the shapeMode argument, or -2 if the SDL_Window given is not a | |
113 * shaped window. | |
114 * | |
115 * \sa SDL_WindowShapeMode | |
116 * \sa SDL_GetShapeParameters | |
117 */ | |
118 extern DECLSPEC int SDLCALL SDL_SetShapeParameters(SDL_Window *window,SDL_WindowShapeMode shapeMode); | |
119 | |
120 /** | |
121 * \brief Set the shape parameters of a shaped window. | |
122 * | |
123 * \param window The shaped window whose parameters should be retrieved. | |
124 * \param shapeMode An empty shape-parameters structure to fill. | |
125 * | |
126 * \return 0 on success, -1 on a null shapeMode, or -2 if the SDL_Window given is not a shaped window. | |
127 * | |
128 * \sa SDL_WindowShapeMode | |
129 * \sa SDL_SetShapeParameters | |
130 */ | |
131 extern DECLSPEC int SDLCALL SDL_GetShapeParameters(SDL_Window *window,SDL_WindowShapeMode *shapeMode); | |
64 | 132 |
65 /* Ends C function definitions when using C++ */ | 133 /* Ends C function definitions when using C++ */ |
66 #ifdef __cplusplus | 134 #ifdef __cplusplus |
67 /* *INDENT-OFF* */ | 135 /* *INDENT-OFF* */ |
68 } | 136 } |