| Summary: | inconsistancy in API between 1.2 and 1.3 for SDL_GetMouseState | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ken Bull <llubnek> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | critical | ||
| Priority: | P1 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://www.libsdl.org/cgi/docwiki.cgi/SDL_GetMouseState | ||
|
Description
Ken Bull
2009-06-26 22:25:30 UTC
I'm not sure we should do a "SelectMouse" API, but we probably shouldn't change the signature of functions that were in 1.2...perhaps a different function name for the new version, and SDL_GetMouseState() will be equivalent to SDL_NewVersionOfGetMouseState(0,x,y), or something. This is the approach I took in adding multiple audio devices to 1.3 ... the 1.2 functions, which can't address a specific piece of hardware, assume the most reasonable default device. Are there other function signatures we've changed like this? I assume this specific one was a GSoC 2008 change. --ryan. (In reply to comment #1) > I'm not sure we should do a "SelectMouse" API, but we probably shouldn't change > the signature of functions that were in 1.2...perhaps a different function name > for the new version, and SDL_GetMouseState() will be equivalent to > SDL_NewVersionOfGetMouseState(0,x,y), or something. There is ALREADY a SDL_SelectMouse function in SDL 1.3. The doxygen documentation for SDL_GetMouseState in 1.3 even says that it uses the "currently selected mouse". It just doesn't. Same thing for SDL_GetRelativeMouseState, SDL_SetRelativeMouseMode, SDL_GetRelativeMouseMod and SDL_GetMouseFocusWindow. SDL_WarpMouseInWindow, SDL_CreateCursor, SDL_SetCursor, SDL_GetCursor and SDL_ShowCursor are currently the only functions that could ask for an index but don't (though multiple cursors aren't really supported yet, each of these refers to SDL_current_mouse in the code), but they also refer to the "currently selected mouse" in the documentation. I'd personally recommend SDL_GetMouseState use the device selected with SDL_SelectMouse and have a SDL_GetMouseStateEx (or similar) which takes a mouse index, and do the same for other similar functions.
> There is ALREADY a SDL_SelectMouse function in SDL 1.3.
Ugh, that should be removed. I'm grabbing this bug, so I can look into this further.
--ryan.
Ryan, this needs to be fixed ASAP however we do it, because currently the iPhone demos don't compile. Priority bump. --ryan. I cleaned this up. SDL_GetMouseState() is now as it was in 1.2. The SelectMouse stuff is still there, but this is a mess I have to sort through. But this should get the iPhone demos, and other existing code, up and running again. This is svn revision #5420. --ryan. |