comparison include/SDL_shape.h @ 4801:506a9165491b

Added #define's for error codes returned from SDL shaped-window API.
author Eli Gottlieb <eligottlieb@gmail.com>
date Sun, 18 Jul 2010 22:24:52 -0400
parents b6930aefd008
children c9eb95f29770
comparison
equal deleted inserted replaced
4800:6d4be626225f 4801:506a9165491b
40 /** \file SDL_shape.h 40 /** \file SDL_shape.h
41 * 41 *
42 * Header file for the shaped window API. 42 * Header file for the shaped window API.
43 */ 43 */
44 44
45 #define SDL_NONSHAPEABLE_WINDOW -1
46 #define SDL_INVALID_SHAPE_ARGUMENT -2
47 #define SDL_WINDOW_LACKS_SHAPE -3
48
45 /** 49 /**
46 * \brief Create a window that can be shaped with the specified position, dimensions, and flags. 50 * \brief Create a window that can be shaped with the specified position, dimensions, and flags.
47 * 51 *
48 * \param title The title of the window, in UTF-8 encoding. 52 * \param title The title of the window, in UTF-8 encoding.
49 * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or 53 * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
56 * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, 60 * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED,
57 * ::SDL_WINDOW_SHOWN, ::SDL_WINDOW_RESIZABLE, 61 * ::SDL_WINDOW_SHOWN, ::SDL_WINDOW_RESIZABLE,
58 * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, 62 * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
59 * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. 63 * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
60 * 64 *
61 * \return The id of the window created, or zero if window creation failed. 65 * \return The window created, or NULL if window creation failed.
62 * 66 *
63 * \sa SDL_DestroyWindow() 67 * \sa SDL_DestroyWindow()
64 */ 68 */
65 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); 69 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
66 70
100 * 104 *
101 * \param window The shaped window whose parameters should be set. 105 * \param window The shaped window whose parameters should be set.
102 * \param shape A surface encoding the desired shape for the window. 106 * \param shape A surface encoding the desired shape for the window.
103 * \param shapeMode The parameters to set for the shaped window. 107 * \param shapeMode The parameters to set for the shaped window.
104 * 108 *
105 * \return 0 on success, -1 on invalid an invalid shape argument, or -2 if the SDL_Window* given does not reference 109 * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
106 * a valid shaped window. 110 * if the SDL_Window* given does not reference a valid shaped window.
107 * 111 *
108 * \sa SDL_WindowShapeMode 112 * \sa SDL_WindowShapeMode
109 * \sa SDL_GetShapedWindowMode. 113 * \sa SDL_GetShapedWindowMode.
110 */ 114 */
111 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode); 115 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode);
115 * 119 *
116 * \param window The shaped window whose parameters should be retrieved. 120 * \param window The shaped window whose parameters should be retrieved.
117 * \param shapeMode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. 121 * \param shapeMode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
118 * 122 *
119 * \return 0 if the window has a shape and, provided shapeMode was not NULL, shapeMode has been filled with the mode 123 * \return 0 if the window has a shape and, provided shapeMode was not NULL, shapeMode has been filled with the mode
120 * data, -1 if the SDL_Window given is not a shaped window, or -2 if the SDL_Window* given is a shapeable 124 * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
121 * window currently lacking a shape. 125 * the SDL_Window* given is a shapeable window currently lacking a shape.
122 * 126 *
123 * \sa SDL_WindowShapeMode 127 * \sa SDL_WindowShapeMode
124 * \sa SDL_SetWindowShape 128 * \sa SDL_SetWindowShape
125 */ 129 */
126 extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shapeMode); 130 extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shapeMode);