Mouse: int and Uint16 ( keypress location ..)

Use SDL_GetMouseState()

Ok, thank you! But now i’ve got another question … SDL_GetMouseState
uses int for its x and y position, while the SDL_MouseMotionEvent and
SDL_MouseButtonEvent use Uint16. Will the location gotten from
GetMouseState be the same as in those events ? Will it ever be
negative or >65536 ?

They will be the same. Future versions of SDL will use int in the events
as well, but the values shouldn’t exceed the range of Uint16.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Use SDL_GetMouseState()

Ok, thank you! But now i’ve got another question …
SDL_GetMouseState uses int for its x and y position, while the
SDL_MouseMotionEvent and SDL_MouseButtonEvent use Uint16. Will
the location gotten from GetMouseState be the same as in those
events ? Will it ever be negative or >65536 ?

They will be the same. Future versions of SDL will use int in the
events as well, but the values shouldn’t exceed the range of
Uint16.

Ok! Another question then =) Will the SDL int types be changed to
pure int in other functions as well (ie, not only in the events) ?
Will you replace all of the SDL int types with pure int ?

Why did you choose to use those size-specific types anyway ? To make
the size of unions roughly the same with various types ?

Maybe it would be better with the C99 types int_fast8_t etc. ? Maybe
just redeclare the SDL types to these ?

Sorry if there’s a bit many question marks in here btw =)–
Trick


Linux User #229006 * http://counter.li.org