From: magnet Date: Thu, 29 Oct 2009 01:45:00 +0000 (+0100) Subject: updated Cdrom and Event and SDL pods, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15a6855a1873836b12bf4f67f0cb600bd4209b6f;p=sdlgit%2FSDL_perl.git updated Cdrom and Event and SDL pods, updated some functions name in the SDL.xs --- diff --git a/lib/SDL.pm b/lib/SDL.pm index e44ddb1..7953486 100644 --- a/lib/SDL.pm +++ b/lib/SDL.pm @@ -253,11 +253,11 @@ SDL::Error doesn't returns any value. SDL::clear_error deletes all information about the last internal SDL error. Useful if the error has been handled by the program. it doesn't returns any value. -=head2 loadobject() +=head2 load_object() Need to be coded. -=head2 loadfunction() +=head2 load_function() Need to be coded. diff --git a/lib/SDL/Cdrom.pm b/lib/SDL/Cdrom.pm index d7fcbfc..9adc3ef 100644 --- a/lib/SDL/Cdrom.pm +++ b/lib/SDL/Cdrom.pm @@ -56,7 +56,7 @@ sub DESTROY { SDL::CDClose($$self); } -sub CD_NUM_DRIVES { +sub cd_num_drives { return SDL::CDNumDrives(); } @@ -155,7 +155,7 @@ SDL::Cdrom - a SDL perl extension for managing CD-ROM drives =item * -C. +C. =back @@ -169,7 +169,7 @@ whereas 0 is the first drive etc. =head1 METHODS -=head2 CD_NUM_DRIVES() +=head2 cd_num_drives() Returns the number of CD-ROM drives present. diff --git a/lib/SDL/Event.pm b/lib/SDL/Event.pm index 0501172..ad37ae4 100644 --- a/lib/SDL/Event.pm +++ b/lib/SDL/Event.pm @@ -240,7 +240,7 @@ See also L. =head2 new() -Create a new event object. +Create a new event object.It returns a SDL::Event. =head2 type() @@ -249,11 +249,32 @@ available. =head2 pump() -=head2 poll() +SDL::Events::pump gathers all the pending input information from devices and places +it on the event queue. +Without calls to pump no events would ever be placed on the queue. +Often the need for calls to pump is hidden from the user +since C and C. +As this function implicitly calls C, you can only call this function in the thread that set the video mode. +it take a SDL::Event as first parameter. + +=head2 wait(event) + +Waits indefinitely for the next available event, returning undef if there was an error while waiting for events, +a L< SDL::Event> otherwise. +If event is not NULL, the next event is removed. +As this function implicitly calls L, you can only call this function in the thread that set the video mode. +WaitEvent take a SDL::Event as first parameter. =head2 set( type, state ) @@ -268,49 +289,80 @@ Toggle unicode on the event. Sets the delay and intervall of the key repeat rate (e.g. when a user holds down a key on the keyboard). -=head2 active_gain() +=head2 active_gain(event) + +active_gain return the active gain from the SDL::Event given as first parameter. + +=head2 active_state(event) + +active_state return the active state from the SDL::Event given as first parameter. + +=head2 key_state(event) + +key_state return the active key state from the SDL::Event given as first parameter. -=head2 active_state() -=head2 key_state() +=head2 key_sym(key) -=head2 key_sym() +key_sym return the key pressed/released information from the SDL::Event given as first parameter. -=head2 key_name() +=head2 get_key_name(key) -=head2 key_mod() +get_key_name get the name of an SDL virtual keysym. +it returns the key name. -=head2 key_unicode() +=head2 key_mod(event) -=head2 key_scancode() +key_mod return the mod keys pressed information from the SDL::Event given as first parameter. -=head2 motion_state() +=head2 key_unicode(event) -=head2 motion_x() +key_unicode return the unicode translated keys pressed/released information from the SDL::Event given as first parameter. + +=head2 key_scancode(event) * to move in SDL::Game::Keyboard + +key_scancode return the hardware specific keyboard scan code from the SDL::Event given as first parameter. + +=head2 motion_state(event) * to move in SDL::Game::Mouse + +motion_state return the state of the mouse button from the SDL::Event given as first parameter. + +=head2 motion_x(event) * to move in SDL::Game::Mouse Returns the motion of the mouse in X direction as an absolute value. +It take a SDL::Event as first parameter. -=head2 motion_y() +=head2 motion_y(event) * to move in SDL::Game::Mouse Returns the motion of the mouse in Y direction as an absolute value. +It take a SDL::Event as first parameter. -=head2 motion_xrel() +=head2 motion_xrel(event) * to move in SDL::Game::Mouse Returns the motion of the mouse in X direction as a relative value. +It take a SDL::Event as first parameter. -=head2 motion_yrel() +=head2 motion_yrel(event) * to move in SDL::Game::Mouse Returns the motion of the mouse in Y direction as a relative value. +It take a SDL::Event as first parameter. -=head2 button_state() +=head2 button_state(event) * to move in SDL::Game::Mouse Returns the state of the mouse buttons. +It take a SDL::Event as first parameter. + +=head2 button_x(event) * to move in SDL::Game::Mouse + +Return the X position of the mouse at keypress.it take a SDL::Event as first parameter. + +=head2 button_y(event) * to move in SDL::Game::Mouse -=head2 button_x() +Return the Y position of the mouse at keypress.it take a SDL::Event as first parameter. -=head2 button_y() +=head2 button(event) * to move in SDL::Game::Mouse -=head2 button() +Return the mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT, SDL_BUTTON_WHEELUP, SDL_BUTTON_WHEELDOWN) =head1 AUTHOR diff --git a/src/SDL.xs b/src/SDL.xs index bf9f64d..8e14ce2 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -726,7 +726,7 @@ KeyEventUnicode ( e ) RETVAL Uint8 -KeyEventScanCode ( e ) +key_scancode ( e ) SDL_Event *e CODE: RETVAL = e->key.keysym.scancode; @@ -774,7 +774,7 @@ MouseMotionYrel ( e ) RETVAL Uint8 -MouseButtonState ( e ) +button_state ( e ) SDL_Event *e CODE: RETVAL = e->button.state; @@ -782,7 +782,7 @@ MouseButtonState ( e ) RETVAL Uint8 -MouseButton ( e ) +button ( e ) SDL_Event *e CODE: RETVAL = e->button.button; @@ -790,7 +790,7 @@ MouseButton ( e ) RETVAL Uint16 -MouseButtonX ( e ) +button_x ( e ) SDL_Event *e CODE: RETVAL = e->button.x; @@ -798,7 +798,7 @@ MouseButtonX ( e ) RETVAL Uint16 -MouseButtonY ( e ) +button_y ( e ) SDL_Event *e CODE: RETVAL = e->button.y; @@ -842,7 +842,7 @@ SetModState ( state ) SDL_SetModState(state); char * -GetKeyName ( sym ) +get_key_name ( sym ) int sym CODE: RETVAL = SDL_GetKeyName(sym);