Finshed Quit, Resize and SysWMEvent
Kartik Thakore [Sun, 8 Nov 2009 03:07:18 +0000 (22:07 -0500)]
src/Core/objects/QuitEvent.xs
src/Core/objects/ResizeEvent.xs
src/Core/objects/SysWMEvent.xs

index 2e11418..719304b 100644 (file)
@@ -37,3 +37,9 @@ qevent_type ( event, ... )
                RETVAL = event->type;
        OUTPUT:
                RETVAL
+
+void
+qevent_DESTROY ( event)
+       SDL_QuitEvent *event
+       CODE:
+               safefree( (char *) event);
index 4ce2b18..f62ea46 100644 (file)
@@ -43,6 +43,12 @@ int
 wrevent_w ( event, ... )
        SDL_ResizeEvent *event
        CODE: 
+               if( items > 1 )
+               {
+                       event->w = SvIV( ST(1) );
+
+               }
+
                RETVAL = event->w;
        OUTPUT:
                RETVAL
@@ -51,6 +57,18 @@ int
 wrevent_h ( event, ... )
        SDL_ResizeEvent *event
        CODE: 
+               if( items > 1 )
+               {
+                       event->h = SvIV( ST(1) );
+
+               }
+
                RETVAL = event->h;
        OUTPUT:
                RETVAL
+
+void
+wrevent_DESTROY ( event)
+       SDL_ResizeEvent *event
+       CODE:
+               safefree( (char *) event);
index 7e91b56..29991ff 100644 (file)
@@ -46,6 +46,20 @@ wmevent_msg ( event, ... )
        PREINIT:
                char* CLASS = "SDL::SysWMmsg";
        CODE: 
-               RETVAL = &(event->msg);
+               if( items > 1 )
+               {
+                       SDL_SysWMmsg * sysm = (SDL_SysWMmsg * )SvPV( ST(1), PL_na) ;
+                       event->msg = sysm;
+
+               }
+
+               RETVAL = event->msg;
        OUTPUT:
                RETVAL
+
+void
+wmevent_DESTROY ( event)
+       SDL_SysWMEvent *event
+       CODE:
+               safefree( (char *) event);
+