Mercurial > sdl-ios-xcode
diff src/events/SDL_mouse.c @ 3774:8b5b67000dc0 gsoc2008_manymouse
Cursor support added
author | Szymon Wilczek <kazeuser@gmail.com> |
---|---|
date | Tue, 05 Aug 2008 14:10:11 +0000 |
parents | 8cc36a399a12 |
children | a9c2a7071874 |
line wrap: on
line diff
--- a/src/events/SDL_mouse.c Mon Aug 04 11:18:10 2008 +0000 +++ b/src/events/SDL_mouse.c Tue Aug 05 14:10:11 2008 +0000 @@ -52,7 +52,8 @@ } int -SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,int pressure_min) +SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name,int pressure_max,\ +int pressure_min, int ends) { SDL_Mouse **mice; int selected_mouse; @@ -98,6 +99,8 @@ thanx to that, the users that don't want to use many mouses don't have to worry about anything*/ SDL_mice[index]->relative_mode=SDL_FALSE; + SDL_mice[index]->current_end=0; + SDL_mice[index]->total_ends=ends; SDL_SelectMouse(selected_mouse); return index; @@ -460,6 +463,7 @@ event.motion.windowID = mouse->focus; event.motion.pressure_max=mouse->pressure_max; event.motion.pressure_min=mouse->pressure_min; + event.motion.cursor=SDL_mice[index]->current_end; posted = (SDL_PushEvent(&event) > 0); } last_x=x; @@ -796,5 +800,24 @@ x_max=x; y_max=y; } + +void SDL_ChangeEnd(int id, int end) +{ + int index=SDL_GetIndexById(id); + SDL_mice[index]->current_end=end; +} + +int SDL_GetCursorsNumber(int index) +{ + if(index>=SDL_num_mice) + { + return -1; + } + if(SDL_mice[index]==NULL) + { + return -1; + } + return SDL_mice[index]->total_ends; +} /* vi: set ts=4 sw=4 expandtab: */