SDL2::system - Platform Specific SDL API Functions
use SDL2 qw[:system];
Depending on your platform, some of these functions will not be defined. They may be imported by name or with the :system tag.
:system
These functions are defined for all platforms.
Platform agnostic functions.
SDL_IsTablet( )
Query if the current device is a tablet.
If SDL can't determine this, it will return SDL_FALSE.
SDL_FALSE
Returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
SDL_TRUE
These functions and defined types will only exist on a system running Windows.
Platform specified functions for Windows.
SDL_SetWindowsMessageHook( ... )
Set a callback for every Windows message, run before TranslateMessage( ).
TranslateMessage( )
Expected parameters include:
callback
SDL_WindowsMessageHook
userdata
SDL_Direct3D9GetAdapterIndex( ... )
Get the D3D9 adapter index that matches the specified display index.
The returned adapter index can be passed to `IDirect3D9::CreateDevice` and controls on which monitor a full screen application will appear.
displayIndex
Returns the D3D9 adapter index on success or a negative error code on failure; call SDL_GetError( ) for more information.
SDL_GetError( )
SDL_RenderGetD3D9Device( ... )
Get the D3D9 device associated with a renderer.
Once you are done using the device, you should release it to avoid a resource leak.
renderer
Returns the D3D9 device associated with given renderer or undef if it is not a D3D9 renderer; call SDL_GetError( ) for more information.
undef
SDL_RenderGetD3D11Device( ... )
Get the D3D11 device associated with a renderer.
Returns the D3D11 device associated with given renderer or undef if it is not a D3D11 renderer; call SDL_GetError( ) for more information.
SDL_DXGIGetOutputInfo( ... )
Get the DXGI Adapter and Output indices for the specified display index.
The DXGI Adapter and Output indices can be passed to EnumAdapters and EnumOutputs respectively to get the objects required to create a DX10 or DX11 device and swap chain.
EnumAdapters
EnumOutputs
adapterIndex
outputIndex
Returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError( ) for more information.
These will only be defined on Windows.
A callback for every Windows message.
Parameters to expect include:
hWnd
message
wParam
lParam
These functions will only exist on a system running Linux.
Sets the UNIX nice value for a thread.
This uses setpriority( ) if possible, and RealtimeKit if available.
setpriority( )
threadID
priority
Returns 0 on success, or -1 on error.
0
-1
The functions related to iOS are not defined. If you somehow manage to get perl running on an iOS device and require these functions, file a bug report at this project's issue tracker and I'll fill in the gaps if you'll assist with testing.
The functions related to Android are not defined. If you require these functions, file a bug report at this project's issue tracker and I'll fill in the gaps if you'll assist with testing.
The functions related to WinRT are not defined. If you somehow manage to get perl running on a device with WinRT and require these functions, file a bug report at this project's issue tracker and I'll fill in the gaps if you'll assist with testing.
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.
Sanko Robinson <sanko@cpan.org>
To install SDL2::FFI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SDL2::FFI
CPAN shell
perl -MCPAN -e shell install SDL2::FFI
For more information on module installation, please visit the detailed CPAN module installation guide.