SDL2-FFI
view release on metacpan or search on metacpan
lib/SDL2/Utils.pm view on Meta::CPAN
use FFI::C::Def;
use FFI::C::ArrayDef;
use FFI::C::StructDef;
use FFI::C::UnionDef;
use FFI::Platypus::Closure;
use File::Spec::Functions qw[catdir canonpath rel2abs];
use Path::Tiny qw[path];
use File::Share qw[dist_dir];
use Config;
use SDL2::Utils::Type::Enum;
use Ref::Util qw( is_ref is_plain_arrayref is_plain_hashref );
sub deprecate ($str) {
warnings::warn( 'deprecated', $str ) if warnings::enabled('deprecated');
}
#sub ver() { # TODO: Remove in favor of SDL2::version
# CORE::state $ver;
# $ver // ffi()->function( SDL_GetVersion => ['SDL_Version'] )
# ->call( $ver = SDL2::Version->new() );
# $ver;
lib/SDL2/Utils/Type/Enum.pm view on Meta::CPAN
package SDL2::Utils::Type::Enum { # Cribbed from FFI::Platypus::Type::Enum
use strict;
use warnings;
use constant 1.32 ();
use 5.008001;
use Ref::Util qw( is_plain_arrayref is_plain_hashref is_ref );
use Scalar::Util qw( dualvar );
use Carp qw( croak );
# ABSTRACT: Custom platypus type for dealing with C enumerated types
our $VERSION = '0.08'; # VERSION
our @CARP_NOT = qw( FFI::Platypus );
sub ffi_custom_type_api_1 {
my %config = defined $_[2] && is_plain_hashref $_[2] ? %{ splice( @_, 2, 1 ) } : ();
my ( undef, undef, @values ) = @_;
( run in 0.243 second using v1.01-cache-2.11-cpan-4d50c553e7e )