SDL_Event *event
CODE:
RETVAL = -1;
- if ( &event != NULL )
+ if ( event != NULL )
RETVAL = SDL_PollEvent(event);
OUTPUT:
RETVAL
event_new (CLASS)
char *CLASS
CODE:
- SDL_Event *empty_event;
- RETVAL = empty_event;
+ RETVAL = (SDL_Event *) safemalloc(sizeof (SDL_Event));
OUTPUT:
RETVAL
SDL_JoyAxisEvent *
event_jaxis ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::JoyAxisEvent";
CODE:
SDL_JoyBallEvent *
event_jball ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::JoyBallEvent";
CODE:
SDL_JoyHatEvent *
event_jhat ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::JoyHatEvent";
CODE:
SDL_JoyButtonEvent *
event_jbutton ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::JoyButtonEvent";
CODE:
SDL_ResizeEvent *
event_resize ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::ResizeEvent";
CODE:
SDL_ExposeEvent *
event_expose ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::ExposeEvent";
CODE:
SDL_QuitEvent *
event_quit ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::QuitEvent";
CODE:
SDL_UserEvent *
event_user ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::UserEvent";
CODE:
SDL_SysWMEvent *
event_syswm ( event, ... )
- SDL_Event *event
+ SDL_Event * event
PREINIT:
char *CLASS = "SDL::SysWMEvent";
CODE:
OUTPUT:
RETVAL
+void
+event_DESTROY(self)
+ SDL_Event *self
+ CODE:
+ safefree( (char *)self );
OUTPUT:
RETVAL
-void
-PumpEvents ()
- CODE:
- SDL_PumpEvents();
-
-int
-PushEvent( e )
- SDL_Event *e
- CODE:
- RETVAL = SDL_PushEvent( e );
- OUTPUT:
- RETVAL
-
-SDL_Event *
-NewEvent ()
- CODE:
- RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event));
- OUTPUT:
- RETVAL
-
-void
-FreeEvent ( e )
- SDL_Event *e
- CODE:
- safefree(e);
-
-int
-PollEvent ( e )
- SDL_Event *e
- CODE:
- RETVAL = SDL_PollEvent(e);
- OUTPUT:
- RETVAL
-
-int
-WaitEvent ( e )
- SDL_Event *e
- CODE:
- RETVAL = SDL_WaitEvent(e);
- OUTPUT:
- RETVAL
-
-Uint8
-EventState ( type, state )
- Uint8 type
- int state
- CODE:
- RETVAL = SDL_EventState(type,state);
- OUTPUT:
- RETVAL
-
-Uint8
-EventType ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->type;
- OUTPUT:
- RETVAL
-
-Uint8
-SetEventType ( e, type )
- SDL_Event *e
- Uint8 type
- CODE:
- RETVAL = e->type;
- e->type = type;
- OUTPUT:
- RETVAL
-
-Uint8
-ActiveEventGain ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->active.gain;
- OUTPUT:
- RETVAL
-
-Uint8
-ActiveEventState ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->active.state;
- OUTPUT:
- RETVAL
-
-Uint8
-KeyEventState( e )
- SDL_Event *e
- CODE:
- RETVAL = e->key.state;
- OUTPUT:
- RETVAL
-
-int
-KeyEventSym ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->key.keysym.sym;
- OUTPUT:
- RETVAL
-
-int
-KeyEventMod ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->key.keysym.mod;
- OUTPUT:
- RETVAL
-
-Uint16
-KeyEventUnicode ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->key.keysym.unicode;
- OUTPUT:
- RETVAL
-
-Uint8
-key_scancode ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->key.keysym.scancode;
- OUTPUT:
- RETVAL
-
-Uint8
-MouseMotionState ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->motion.state;
- OUTPUT:
- RETVAL
-
-Uint16
-MouseMotionX ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->motion.x;
- OUTPUT:
- RETVAL
-
-Uint16
-MouseMotionY ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->motion.y;
- OUTPUT:
- RETVAL
-
-Sint16
-MouseMotionXrel( e )
- SDL_Event *e
- CODE:
- RETVAL = e->motion.xrel;
- OUTPUT:
- RETVAL
-
-Sint16
-MouseMotionYrel ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->motion.yrel;
- OUTPUT:
- RETVAL
-
-Uint8
-button_state ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->button.state;
- OUTPUT:
- RETVAL
-
-Uint8
-button ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->button.button;
- OUTPUT:
- RETVAL
-
-Uint16
-button_x ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->button.x;
- OUTPUT:
- RETVAL
-
-Uint16
-button_y ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->button.y;
- OUTPUT:
- RETVAL
-
-SDL_SysWMmsg *
-SysWMEventMsg ( e )
- SDL_Event *e
- CODE:
- RETVAL = e->syswm.msg;
- OUTPUT:
- RETVAL
-
int
EnableUnicode ( enable )
int enable
use SDL::SysWMEvent;
use SDL::UserEvent;
use SDL::Video;
+use Devel::Peek;
use Test::More;
-plan ( tests => 66 );
+plan ( tests => 69 );
my @done =qw/
pump_events
peep_events
+push_event
+poll_event
/;
my @done_event =qw/
my $wmevent = SDL::SysWMEvent->new();
my $uevent = SDL::UserEvent->new();
-#isa_ok( $event, 'SDL::Event', '[SDL::Event::new] is creating an Event');
+isa_ok( $event, 'SDL::Event', '[SDL::Event::new] is creating an Event');
isa_ok( $aevent, 'SDL::ActiveEvent', '[SDL::ActiveEvent::new] is creating an ActiveEvent');
isa_ok( $weevent, 'SDL::ExposeEvent', '[SDL::ExposeEvent::new] is creating an ExposeEvent');
isa_ok( $jaevent, 'SDL::JoyAxisEvent', '[SDL::JoyAxisEvent::new] is creating an JoyAxisEvent');
is($wmevent->type, SDL_SYSWMEVENT, '[SDL::SysWMEvent->type] returns correctly');
is($uevent->type, SDL_USEREVENT, '[SDL::UserEvent->type] returns correctly');
+my $num_peep_events = SDL::Events::peep_events($event, 127, SDL_PEEKEVENT, SDL_ALLEVENTS);
+is($num_peep_events >= 0, 1, '[peep_events] Size of event queue is ' . $num_peep_events);
+
+
+SDL::Events::push_event($aevent); pass '[push_event] ran';
+
+SDL::Events::poll_event($event);
+
+is( $event->type, $aevent->type, '[poll_event] Got the right event back out') ;
+
$uevent->code(200);
is( $uevent->code, 200, '[SDL::UserEvent->code] is set correctly');
-my $num_peep_events = SDL::Events::peep_events($event, 127, SDL_PEEKEVENT, SDL_ALLEVENTS);
-is($num_peep_events >= 0, 1, '[peep_events] Size of event queue is ' . $num_peep_events);
TODO:
{
Sint16 * T_PTR
Sint32 T_IV
Sint32 * T_PTR
-SDL_Event * T_PTR
+SDL_Event * O_OBJECT
SDL_ActiveEvent * O_OBJECT
SDL_KeyboardEvent * O_OBJECT
SDL_TextInputEvent * O_OBJECT