diff include/SDL_video.h @ 5168:2b1989f59674

Extended SDL_SetWindowData() to allow arbitrary named values.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 03 Feb 2011 11:16:57 -0800
parents fb424691cfc7
children 4d39eeaad00b
line wrap: on
line diff
--- a/include/SDL_video.h	Thu Feb 03 10:03:55 2011 -0800
+++ b/include/SDL_video.h	Thu Feb 03 11:16:57 2011 -0800
@@ -483,24 +483,39 @@
                                                SDL_Surface * icon);
 
 /**
- *  \brief Associate an arbitrary pointer with a window.
+ *  \brief Associate an arbitrary named pointer with a window.
  *  
+ *  \param window   The window to associate with the pointer.
+ *  \param name     The name of the pointer.
+ *  \param userdata The associated pointer.
+ *
+ *  \return The previous value associated with 'name'
+ *
+ *  \note The name is case-sensitive.
+ *
  *  \sa SDL_GetWindowData()
  */
-extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_Window * window,
-                                               void *userdata);
+extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
+                                                const char *name,
+                                                void *userdata);
 
 /**
  *  \brief Retrieve the data pointer associated with a window.
  *  
+ *  \param window   The window to query.
+ *  \param name     The name of the pointer.
+ *
+ *  \return The value associated with 'name'
+ *  
  *  \sa SDL_SetWindowData()
  */
-extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window);
+extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window,
+                                                const char *name);
 
 /**
  *  \brief Set the position of a window.
  *  
- *  \param window The window to reposition.
+ *  \param window   The window to reposition.
  *  \param x        The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
                     ::SDL_WINDOWPOS_UNDEFINED.
  *  \param y        The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or