SDL2-FFI
view release on metacpan or search on metacpan
lib/SDL2/hints.pm view on Meta::CPAN
By default SDL will generate mouse events for touch events.
=item C<SDL_HINT_MOUSE_TOUCH_EVENTS>
A variable controlling whether mouse events should generate synthetic touch
events
This variable can be set to the following values:
0 Mouse events will not generate touch events (default for desktop platforms)
1 Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
=item C<SDL_HINT_IOS_HIDE_HOME_INDICATOR>
A variable controlling whether the home indicator bar on iPhone X should be
hidden.
This variable can be set to the following values:
0 The indicator bar is not hidden (default for windowed applications)
lib/SDL2/mouse.pm view on Meta::CPAN
=item C<x> - the x coordinate of the mouse cursor position relative to the focus window
=item C<y> - the y coordinate of the mouse cursor position relative to the focus window
=back
Returns a 32-bit button bitmask of the current button state.
=head2 C<SDL_GetGlobalMouseState( ... )>
Get the current state of the mouse in relation to the desktop.
This works similarly to L<< C<SDL_GetMouseState( ... )>|/C<SDL_GetMouseState(
... )> >>, but the coordinates will be reported relative to the top-left of the
desktop. This can be useful if you need to track the mouse outside of a
specific window and L<< C<SDL_CaptureMouse( ... )>|/C<SDL_CaptureMouse( ... )>
>> doesn't fit your needs. For example, it could be useful if you need to track
the mouse while dragging a window, where coordinates relative to a window might
not be in sync at all times.
Note: L<< C<SDL_GetMouseState( ... )>|/C<SDL_GetMouseState( ... )> >> returns
the mouse position as SDL understands it from the last pump of the event queue.
This function, however, queries the OS for the current mouse position, and as
such, might be a slightly less efficient function. Unless you know what you're
doing and have a good reason to use this function, you probably want L<<
C<SDL_GetMouseState( ... )>|/C<SDL_GetMouseState( ... )> >> instead.
Expected parameters include:
=over
=item C<x> - filled in with the current X coord relative to the desktop; can be C<undef>
=item C<y> - filled in with the current Y coord relative to the desktop; can be C<undef>
=back
Returns the current button state as a bitmask which can be tested using C<the
SDL_BUTTON( X )> macros.
=head2 C<SDL_GetRelativeMouseState( ... )>
Retrieve the relative state of the mouse.
lib/SDL2/video.pm view on Meta::CPAN
=item C<displayIndex> the index of display from which the name should be queried
=back
Returns the name of a display or C<undef> for an invalid display index or
failure; call C<SDL_GetError( )> for more information.
=head2 C<SDL_GetDisplayBounds( ... )>
Get the desktop area represented by a display.
SDL_GetDisplayBounds( 0, my $rect );
The primary display (C<displayIndex> zero) is always located at C<0,0>.
Expected parameters include:
=over
=item C<displayIndex> - the index of the display to query
=item C<rect> - the L<SDL2::Rect> structure filled in with the display bounds
=back
Returns C<0> on success or a negative error code on failure; call
C<SDL_GetError( )> for more information.
=head2 C<SDL_GetDisplayUsableBounds( ... )>
Get the usable desktop area represented by a display.
SDL_GetDisplayUsableBounds( 0, my $rect );
The primary display (C<displayIndex> zero) is always located at C<0,0>.
This is the same area as C<SDL_GetDisplayBounds( ... )> reports, but with
portions reserved by the system removed. For example, on Apple's macOS, this
subtracts the area occupied by the menu bar and dock.
Setting a window to be fullscreen generally bypasses these unusable areas, so
lib/SDL2/video.pm view on Meta::CPAN
=item C<mode> - an L<SDL2::DisplayMode> structure filled in with the mode at C<modeIndex>
=back
Returns C<0> on success or a negative error code on failure; call
C<SDL_GetError( )> for more information.
=head2 C<SDL_GetDesktopDisplayMode( ... )>
Get information about the desktop's display mode.
There's a difference between this function and L<< C<SDL_GetCurrentDisplayMode(
... )>|/C<SDL_GetCurrentDisplayMode( ... )> >> when SDL runs fullscreen and has
changed the resolution. In that case this function will return the previous
native display mode, and not the current display mode.
Expected parameters include:
=over
lib/SDL2/video.pm view on Meta::CPAN
Returns C<0> on success or a negative error code on failure; call
C<SDL_GetError( )> for more information.
=head2 C<SDL_GetClosestDisplayMode( ... )>
Get the closest match to the requested display mode.
The available display modes are scanned and C<closest> is filled in with the
closest mode matching the requested mode and returned. The mode format and
refresh rate default to the desktop mode if they are set to C<0>. The modes are
scanned with size being first priority, format being second priority, and
finally checking the refresh rate. If all the available modes are too small,
then C<undef> is returned.
Expected parameters include:
=over
=item C<displayIndex> - the index of the display to query
lib/SDL2/video.pm view on Meta::CPAN
This only affects the display mode used when the window is fullscreen. To
change the window size when the window is not fullscreen, use
SDL_SetWindowSize().
Expected parameters include:
=over
=item C<window> - the window to affect
=item C<mode> - the L<SDL2::DisplayMode> structure representing the mode to use, or C<undef> to use the window's dimensions and the desktop's format and refresh rate
=back
Returns C<0> on success or a negative error code on failure; call
C<SDL_GetError( )> for more information.
=head2 C<SDL_GetWindowDisplayMode( ... )>
Query the display mode to use when a window is visible at fullscreen.
lib/SDL2/video.pm view on Meta::CPAN
1280, 720,
SDL_WINDOW_SHOWN
);
C<flags> may be any of the following OR'd together:
=over
=item C<SDL_WINDOW_FULLSCREEN> - fullscreen window
=item C<SDL_WINDOW_FULLSCREEN_DESKTOP> - fullscreen window at desktop resolution
=item C<SDL_WINDOW_OPENGL> - window usable with an OpenGL context
=item C<SDL_WINDOW_VULKAN> - window usable with a Vulkan instance
=item C<SDL_WINDOW_METAL> - window usable with a Metal instance
=item C<SDL_WINDOW_HIDDEN> - window is not visible
=item C<SDL_WINDOW_BORDERLESS> - no window decoration
lib/SDL2/video.pm view on Meta::CPAN
=item C<window> - the window to restore
=back
=head2 C<SDL_SetWindowFullscreen( ... )>
Set a window's fullscreen state.
C<flags> may be C<SDL_WINDOW_FULLSCREEN>, for "real" fullscreen with a
videomode change; C<SDL_WINDOW_FULLSCREEN_DESKTOP> for "fake" fullscreen that
takes the size of the desktop; and 0 for windowed mode.
Expected parameters include:
=over
=item C<window> - the window to change
=item C<flags> - C<SDL_WINDOW_FULLSCREEN>, C<SDL_WINDOW_FULLSCREEN_DESKTOP> or C<0>
=back
( run in 0.288 second using v1.01-cache-2.11-cpan-299005ec8e3 )