OUTPUT:
RETVAL
+Uint8
+event_active_type ( event)
+ SDL_Event *event
+ CODE:
+ SDL_ActiveEvent * a = &(event->active);
+ RETVAL = a->type;
+ OUTPUT:
+ RETVAL
+
+
+Uint8
+event_active_gain ( event, ... )
+ SDL_Event *event
+ CODE:
+ SDL_ActiveEvent * a = &(event->active);
+
+ if( items > 1 )
+ {
+ a->gain = SvIV( ST(1) );
+
+ }
+ RETVAL = a->gain;
+ OUTPUT:
+ RETVAL
+
+Uint8
+event_active_state ( event, ... )
+ SDL_Event *event
+ CODE:
+ SDL_ActiveEvent * a = &(event->active);
+ if( items > 1 )
+ {
+ a->state = SvIV( ST(1) );
+
+ }
+
+ RETVAL = a->state;
+ OUTPUT:
+ RETVAL
+
+
SDL_KeyboardEvent *
event_key ( event, ... )
SDL_Event *event
event_DESTROY(self)
SDL_Event *self
CODE:
- //safefree( (char *)self );
+ safefree( (char *)self );
use SDL;
use SDL::Event;
use SDL::Events;
-use SDL::ActiveEvent;
use SDL::ExposeEvent;
use SDL::JoyAxisEvent;
use SDL::JoyBallEvent;
can_ok( 'SDL::Events', @done);
can_ok( 'SDL::Event', @done_event);
-can_ok( 'SDL::ActiveEvent', qw/type gain state/);
can_ok( 'SDL::ExposeEvent', qw/type/);
can_ok( 'SDL::JoyAxisEvent', qw/type which axis value/);
can_ok( 'SDL::JoyBallEvent', qw/type which ball xrel yrel/);
is($wrevent->type, SDL_VIDEORESIZE, '[SDL::ResizeEvent->type] returns correctly');
is($wmevent->type, SDL_SYSWMEVENT, '[SDL::SysWMEvent->type] returns correctly');
is($uevent->type, SDL_USEREVENT, '[SDL::UserEvent->type] returns correctly');
-=cut
SDL::init(SDL_INIT_VIDEO);
my $aevent = SDL::Event->new();
$aevent->type( SDL_ACTIVEEVENT);
-$aevent->active->gain(1);
-$aevent->active->state(SDL_APPMOUSEFOCUS);
+$aevent->active_gain(1);
+$aevent->active_state(SDL_APPMOUSEFOCUS);
-my $weevent = SDL::Event->new();
-$weevent->type(SDL_VIDEOEXPOSE);
+#my $weevent = SDL::Event->new();
+#$weevent->type(SDL_VIDEOEXPOSE);
SDL::Events::push_event($aevent); pass '[push_event] Pushed in an Active Event';
}
is( $got_event, 1, '[poll_event] Got an Active event back out') ;
-is( $event->active->gain() , 1, '[poll_event] Got right active->gain');
-is( $event->active->state() , SDL_APPMOUSEFOCUS, '[poll_event] Got right active->state');
+is( $event->active_gain() , 1, '[poll_event] Got right active->gain');
+is( $event->active_state() , SDL_APPMOUSEFOCUS, '[poll_event] Got right active->state');
-SDL::Events::push_event($weevent); pass '[push_event] ran';
+SDL::Events::push_event($aevent); pass '[push_event] ran';
SDL::Events::pump_events();
is( $value, 1, '[wait_event] waited for event');
-SDL::Events::push_event($weevent); pass '[push_event] ran';
+SDL::Events::push_event($aevent); pass '[push_event] ran';
SDL::Events::pump_events();
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);
-
+=cut
my @left = qw/