SDL3
view release on metacpan or search on metacpan
create custom modes, dictating what sort of math to do on what color components.
See [SDL3: CategoryBlendmode](https://wiki.libsdl.org/SDL3/CategoryBlendmode)
### `:camera` - Camera Support
Video capture for the SDL library.
See [SDL3: CategoryCamera](https://wiki.libsdl.org/SDL3/CategoryCamera)
### `:clipboard` - Clipboard Handling
SDL provides access to the system clipboard, both for reading information from other processes and publishing
information of its own.
This is not just text! SDL apps can access and publish data by mimetype.
See [SDL3: CategoryClipboard](https://wiki.libsdl.org/SDL3/CategoryClipboard)
### `:cpuinfo` - CPU Feature Detection
CPU feature detection for SDL.
lib/SDL3.pm view on Meta::CPAN
sub _all() {
state $done++ && return;
_stdinc();
_assert();
_asyncio();
_atomic();
_audio();
_bits();
_blendmode();
_camera();
_clipboard();
_cpuinfo();
_dialog();
_error();
_events();
_filesystem();
_gamepad();
_gpu();
_guid();
_haptic();
_hidapi();
lib/SDL3.pm view on Meta::CPAN
_affix_and_export SDL_OpenCamera => [ SDL_CameraID(), Pointer [ SDL_CameraSpec() ] ], Pointer [ SDL_Camera() ];
_affix_and_export SDL_GetCameraPermissionState => [ Pointer [ SDL_Camera() ] ], SDL_CameraPermissionState();
_affix_and_export SDL_GetCameraID => [ Pointer [ SDL_Camera() ] ], SDL_CameraID();
_affix_and_export SDL_GetCameraProperties => [ Pointer [ SDL_Camera() ] ], SDL_PropertiesID();
_affix_and_export SDL_GetCameraFormat => [ Pointer [ SDL_Camera() ], Pointer [ SDL_CameraSpec() ] ], Bool;
_affix_and_export SDL_AcquireCameraFrame => [ Pointer [ SDL_Camera() ], Pointer [UInt64] ], Pointer [ SDL_Surface() ];
_affix_and_export SDL_ReleaseCameraFrame => [ Pointer [ SDL_Camera() ], Pointer [ SDL_Surface() ] ], Void;
_affix_and_export SDL_CloseCamera => [ Pointer [ SDL_Camera() ] ], Void;
}
=head3 C<:clipboard> - Clipboard Handling
SDL provides access to the system clipboard, both for reading information from other processes and publishing
information of its own.
This is not just text! SDL apps can access and publish data by mimetype.
See L<SDL3: CategoryClipboard|https://wiki.libsdl.org/SDL3/CategoryClipboard>
=cut
sub _clipboard() {
state $done++ && return;
#
_error();
_stdinc();
#
_affix_and_export SDL_SetClipboardText => [String], Bool;
_affix_and_export SDL_GetClipboardText => [], String;
_affix_and_export SDL_HasClipboardText => [], Bool;
_affix_and_export SDL_SetPrimarySelectionText => [String], Bool;
_affix_and_export SDL_GetPrimarySelectionText => [], String;
lib/SDL3.pm view on Meta::CPAN
user => SDL_UserEvent(),
tfinger => SDL_TouchFingerEvent(),
pinch => SDL_PinchFingerEvent(),
pproximity => SDL_PenProximityEvent(),
ptouch => SDL_PenTouchEvent(),
pmotion => SDL_PenMotionEvent(),
pbutton => SDL_PenButtonEvent(),
paxis => SDL_PenAxisEvent(),
render => SDL_RenderEvent(),
drop => SDL_DropEvent(),
clipboard => SDL_ClipboardEvent(),
padding => Array [ UInt8, 128 ]
];
_affix_and_export SDL_PumpEvents => [], Void;
_enum_and_export SDL_EventAction => [ 'SDL_ADDEVENT', 'SDL_PEEKEVENT', 'SDL_GETEVENT' ];
_affix_and_export SDL_PeepEvents => [ Pointer [ SDL_Event() ], Int, SDL_EventAction(), UInt32, UInt32 ], Int;
_affix_and_export SDL_HasEvent => [UInt32], Bool;
_affix_and_export SDL_HasEvents => [ UInt32, UInt32 ], Bool;
_affix_and_export SDL_FlushEvent => [UInt32], Void;
_affix_and_export SDL_FlushEvents => [ UInt32, UInt32 ], Void;
_affix_and_export SDL_PollEvent => [ Pointer [ SDL_Event() ] ], Bool;
t/000_compile.t view on Meta::CPAN
ok SDL_SetHint( SDL_HINT_VIDEO_DRIVER, 'dummy' ), 'Set video driver to dummy';
is SDL_GetHint(SDL_HINT_VIDEO_DRIVER), 'dummy', 'Verified video driver hint';
};
subtest ':init' => sub {
imported_ok qw[SDL_Init SDL_Quit SDL_WasInit SDL_INIT_VIDEO SDL_INIT_EVENTS];
# Initialize video (which implies events)
ok SDL_Init( SDL_INIT_VIDEO | SDL_INIT_EVENTS ), 'SDL_Init(VIDEO | EVENTS)';
is SDL_WasInit(SDL_INIT_VIDEO), SDL_INIT_VIDEO, 'SDL_WasInit confirms VIDEO is initialized';
};
subtest ':clipboard' => sub { # This must come after SDL_Init...
imported_ok qw[SDL_SetClipboardText SDL_GetClipboardText];
ok SDL_SetClipboardText('Perl SDL3 Rocks'), 'Set clipboard text';
# On some strict headless CI (like minimal docker containers),
# clipboard internal operations might fail or return empty strings.
# We check if the call didn't crash, but getting the value back depends on OS support.
my $txt = SDL_GetClipboardText();
diag "Clipboard contains: " . ( $txt // '<undef>' );
};
subtest ':error' => sub {
imported_ok qw[SDL_SetError SDL_GetError SDL_ClearError];
is SDL_SetError('Test Error'), F(), 'SDL_SetError(...)';
is SDL_GetError(), 'Test Error', 'SDL_SetError set the message correctly';
SDL_ClearError();
is SDL_GetError(), "", 'SDL_ClearError cleared message';
( run in 0.542 second using v1.01-cache-2.11-cpan-2398b32b56e )