Re: accessing C union members...
- Posted by mattlewis (admin) Jan 10, 2013
- 1127 views
ssallen said...
I want to check the type field in the event union and if it equals SDL_MOUSEBUTTONDOWN then I want to check the button field that is part of the struct. Any help is appreciated!
It looks like you're doing the detection of SDL_MOUSEBUTTONDOWN correctly. The button should be at sdl_event + 2, so you should be able to read it with peek( sdl_event + 2 ).
Matt