include/SDL_shape.h
changeset 11167 333ababd02e4
parent 10737 3406a0f8b041
child 11811 5d94cb6b24d3
equal deleted inserted replaced
11166:430e1cb56630 11167:333ababd02e4
    69  * \brief Return whether the given window is a shaped window.
    69  * \brief Return whether the given window is a shaped window.
    70  *
    70  *
    71  * \param window The window to query for being shaped.
    71  * \param window The window to query for being shaped.
    72  *
    72  *
    73  * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
    73  * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
       
    74  *
    74  * \sa SDL_CreateShapedWindow
    75  * \sa SDL_CreateShapedWindow
    75  */
    76  */
    76 extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
    77 extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
    77 
    78 
    78 /** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
    79 /** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
    89 
    90 
    90 #define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
    91 #define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
    91 
    92 
    92 /** \brief A union containing parameters for shaped windows. */
    93 /** \brief A union containing parameters for shaped windows. */
    93 typedef union {
    94 typedef union {
    94     /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */
    95     /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */
    95     Uint8 binarizationCutoff;
    96     Uint8 binarizationCutoff;
    96     SDL_Color colorKey;
    97     SDL_Color colorKey;
    97 } SDL_WindowShapeParams;
    98 } SDL_WindowShapeParams;
    98 
    99 
    99 /** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
   100 /** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
   109  *
   110  *
   110  * \param window The shaped window whose parameters should be set.
   111  * \param window The shaped window whose parameters should be set.
   111  * \param shape A surface encoding the desired shape for the window.
   112  * \param shape A surface encoding the desired shape for the window.
   112  * \param shape_mode The parameters to set for the shaped window.
   113  * \param shape_mode The parameters to set for the shaped window.
   113  *
   114  *
   114  * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
   115  * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
   115  *           if the SDL_Window* given does not reference a valid shaped window.
   116  *           if the SDL_Window given does not reference a valid shaped window.
   116  *
   117  *
   117  * \sa SDL_WindowShapeMode
   118  * \sa SDL_WindowShapeMode
   118  * \sa SDL_GetShapedWindowMode.
   119  * \sa SDL_GetShapedWindowMode.
   119  */
   120  */
   120 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
   121 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
   125  * \param window The shaped window whose parameters should be retrieved.
   126  * \param window The shaped window whose parameters should be retrieved.
   126  * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
   127  * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
   127  *
   128  *
   128  * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
   129  * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
   129  *           data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
   130  *           data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
   130  *           the SDL_Window* given is a shapeable window currently lacking a shape.
   131  *           the SDL_Window given is a shapeable window currently lacking a shape.
   131  *
   132  *
   132  * \sa SDL_WindowShapeMode
   133  * \sa SDL_WindowShapeMode
   133  * \sa SDL_SetWindowShape
   134  * \sa SDL_SetWindowShape
   134  */
   135  */
   135 extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);
   136 extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);