NAME

SDL2::system - Platform Specific SDL API Functions

SYNOPSIS

use SDL2 qw[:system];

DESCRIPTION

Depending on your platform, some of these functions will not be defined. They may be imported by name or with the :system tag.

General

These functions are defined for all platforms.

Functions.

Platform agnostic functions.

SDL_IsTablet( )

Query if the current device is a tablet.

If SDL can't determine this, it will return SDL_FALSE.

Returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.

Windows

These functions and defined types will only exist on a system running Windows.

Functions

Platform specified functions for Windows.

SDL_SetWindowsMessageHook( ... )

Set a callback for every Windows message, run before TranslateMessage( ).

Expected parameters include:

callback - the SDL_WindowsMessageHook function to call.
userdata - a pointer to pass to every iteration of callback

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.

Expected parameters include:

displayIndex - the display index for which to get the D3D9 adapter index

Returns the D3D9 adapter index on success or a negative error code on failure; call SDL_GetError( ) for more information.

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.

Expected parameters include:

renderer the renderer from which to get the associated D3D device

Returns the D3D9 device associated with given renderer or undef if it is not a D3D9 renderer; call SDL_GetError( ) for more information.

SDL_RenderGetD3D11Device( ... )

Get the D3D11 device associated with a renderer.

Once you are done using the device, you should release it to avoid a resource leak.

Expected parameters include:

renderer - the renderer from which to get the associated D3D11 device

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.

displayIndex - the display index for which to get both indices
adapterIndex - a pointer to be filled in with the adapter index
outputIndex - a pointer to be filled in with the output index

Returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError( ) for more information.

Defined Values and Enumerations

These will only be defined on Windows.

SDL_WindowsMessageHook

A callback for every Windows message.

Parameters to expect include:

userdata
hWnd
message
wParam
lParam

Linux

These functions will only exist on a system running Linux.

Functions

Sets the UNIX nice value for a thread.

This uses setpriority( ) if possible, and RealtimeKit if available.

Expected parameters include:

threadID - the Unix thread ID to change priority of
priority - the new, Unix-specific, priority value

Returns 0 on success, or -1 on error.

iOS

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.

Android

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.

WinRT

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.

LICENSE

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.

AUTHOR

Sanko Robinson <sanko@cpan.org>