Skip to content

Commit

Permalink
Tweaked hit-testing documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 29, 2014
1 parent 7364ed0 commit 661548c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion include/SDL_video.h
Expand Up @@ -791,13 +791,23 @@ extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
Uint16 * green,
Uint16 * blue);

/**
* \brief Possible return values from the SDL_HitTest callback.
*
* \sa SDL_HitTest
*/
typedef enum
{
SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */
SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */
/* !!! FIXME: resize enums here. */
} SDL_HitTestResult;

/**
* \brief Callback used for hit-testing.
*
* \sa SDL_SetWindowHitTest
*/
typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
const SDL_Point *area,
void *data);
Expand Down Expand Up @@ -826,7 +836,13 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
* Platforms that don't support this functionality will return -1
* unconditionally, even if you're attempting to disable hit-testing.
*
* Your callback may fire at any time.
* Your callback may fire at any time, and its firing does not indicate any
* specific behavior (for example, on Windows, this certainly might fire
* when the OS is deciding whether to drag your window, but it fires for lots
* of other reasons, too, some unrelated to anything you probably care about
* _and when the mouse isn't actually at the location it is testing_).
* Since this can fire at any time, you should try to keep your callback
* efficient, devoid of allocations, etc.
*
* \param window The window to set hit-testing on.
* \param callback The callback to call when doing a hit-test.
Expand Down

0 comments on commit 661548c

Please sign in to comment.