lib/SDL3.pm

filter: Statementstmt 80.0% 8 / 10 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 85.7% 12 / 14 CC 1 SCAR 0.7
CC
1
Cov
80%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/SDL3/Mixer.pm ↑ Summary
1 package SDL3 v0.0.7 {
2 7 ▶ use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 7 ▶ use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶ use Affix qw[:all];
Subroutine BEGIN: called CC=1 SCAR=0.0
5 0 ▶ use Alien::SDL3;
Subroutine BEGIN: called CC=1 SCAR=2.6
6 use Carp qw[croak cluck confess];
7 use Config qw[%Config];
8
9 =encoding utf-8
10
11 =head1 NAME
12
13 SDL3 - Perl Wrapper for the Simple DirectMedia Layer 3.0
14
15 =head1 SYNOPSIS
16
17 use v5.40;
18 use SDL3 qw[:all :main];
19 my ( $x, $y, $dx, $dy, $ren ) = ( 300, 200, 5, 5 );
20
21 sub SDL_AppInit( $app, $ac, $av ) {
22 state $win;
23 SDL_Init(SDL_INIT_VIDEO);
24 SDL_CreateWindowAndRenderer( 'Bouncing Box', 640, 480, 0, \$win, \$ren );
25 SDL_SetRenderVSync( $ren, 1 );
26 SDL_APP_CONTINUE;
27 }
28
29 sub SDL_AppEvent( $app, $ev ) {
30 $ev->{type} == SDL_EVENT_QUIT ? SDL_APP_SUCCESS : SDL_APP_CONTINUE;
31 }
32
33 sub SDL_AppIterate($app) {
34 $dx *= -1 if $x <= 0 || $x >= 620; # Bounce X (Window 640 - Rect 20)
35 $dy *= -1 if $y <= 0 || $y >= 460; # Bounce Y (Window 480 - Rect 20)
36 $x += $dx;
37 $y += $dy;
38 SDL_SetRenderDrawColor( $ren, 20, 20, 30, 255 );
39 SDL_RenderClear($ren);
40 SDL_SetRenderDrawColor( $ren, int($x) % 255, int($y) % 255, 200, 255 );
41 SDL_RenderFillRect( $ren, { x => $x, y => $y, w => 20, h => 20 } );
42 SDL_RenderPresent($ren);
43 SDL_APP_CONTINUE;
44 }
45 sub SDL_AppQuit { }
46
47 =for html <center><img src="https://raw.githubusercontent.com/Perl-SDL3/.github/refs/heads/main/screenshots/synopsis.gif" /></center>
48
49 =head1 DESCRIPTION
50
51 This module provides a Perl wrapper for SDL3, a cross-platform development library designed to provide low level access
52 to audio, keyboard, mouse, joystick, and graphics hardware.
53
54 There are a few examples in this distribution's C<eg/> directory.
55
56 =head2 Features
57
58 Each feature listed below is a tag you may use.
59
60 =cut
61
62 my $alien = Alien::SDL3->new;
63 my $sdl3 = $alien->alt('libsdl3')->package_info;
64 croak 'Could not find SDL3' unless $sdl3;
65 my ( $lib, @etc ) = @{ $sdl3->libfiles };
66
67 #~ print Dumper $sdl3->runtime_deps;
68 $ENV{PATH} = join( $Config{path_sep}, ( map { @{ $_->bindirs // [] } } $sdl3 ), $ENV{PATH} // '' );
69
70 #~ Affix::load_library($_) or die 'Could not find ' . $_ for $lib, @etc;
71 our ( %EXPORT_TAGS, @EXPORT_OK );
72 my $main_hook;
73
74 sub import ( $pkg, @wants ) {
75 {
76 no strict 'refs';
77 (s[^:][_]r)->() for @wants;
78 }
79 $main_hook //= caller if grep { $_ eq ':main' } @wants;
80 #
81 require List::Util;
82 @EXPORT_OK = sort map {@$_} values %EXPORT_TAGS;
83 $EXPORT_TAGS{all} = [@EXPORT_OK];
84 __PACKAGE__->export_to_level( 1, $pkg, @wants );
85 }
86 #
87 sub _affix_and_export( $name, $args, $ret ) {
88 my ( $n, $r ) = ref $name ? @$name : ( $name, $name );
89 confess "Failed to affix $n" unless affix( $lib, $name, $args, $ret );
90 push @{ $EXPORT_TAGS{ [ caller(1) ]->[3] =~ s/^.+?_//r } }, $n;
91 }
92
93 sub _const_and_export( $name, $value ) {
94 no strict 'refs';
95 *{$name} = sub() {$value};
96 push @{ $EXPORT_TAGS{ [ caller(1) ]->[3] =~ s/^.+?_//r } }, $name;
97 }
98 sub _export( $name, @tags ) { push @{ $EXPORT_TAGS{ [ caller(1) ]->[3] =~ s/^.+?_//r } }, $name }
99
100 sub _func_and_export( $name, $sub ) {
101 no strict 'refs';
102 my ( undef, undef, undef, $tag ) = caller;
103 *{$name} = $sub;
104 push @{ $EXPORT_TAGS{ [ caller(1) ]->[3] =~ s/^.+?_//r } }, $name;
105 }
106
107 sub _typedef_and_export( $name, $type //= () ) {
108 no strict 'refs';
109 if ( defined $type ) {
110 typedef $name, $type;
111 }
112 else {
113 typedef $name;
114 }
115 push @{ $EXPORT_TAGS{ [ caller(1) ]->[3] =~ s/^.+?_//r } }, $name;
116 }
117
118 sub _enum_and_export( $name, $values ) {
119 no strict 'refs';
120 my ( undef, undef, undef, $tag ) = caller;
121 typedef $name, Enum [@$values];
122 push @{ $EXPORT_TAGS{ [ caller(1) ]->[3] =~ s/^.+?_//r } }, $name;
123
124 #~ my $value = 0;
125 for my $enum (@$values) {
126 push @{ $EXPORT_TAGS{ [ caller(1) ]->[3] =~ s/^.+?_//r } }, ref $enum ? $enum->[0] : $enum;
127 }
128 }
129
130 sub _internal() {
131 __PACKAGE__->export_to_level( 1, [caller]->[0], qw[_enum_and_export _typedef_and_export _func_and_export _export _affix_and_export] );
132 }
133
134 =head3 C<:all>
135
136 This binds all functions, defines all types, and imports them into your package.
137
138 See L<the SDL3 Wiki|https://wiki.libsdl.org/SDL3/FrontPage> for documentation of the hundreds of types and functions
139 you'll have access to with this import tag.
140
141 =cut
142
143 sub _all() {
144 state $done++ && return;
145 _stdinc();
146 _assert();
147 _asyncio();
148 _atomic();
149 _audio();
150 _bits();
151 _blendmode();
152 _camera();
153 _clipboard();
154 _cpuinfo();
155 _dialog();
156 _error();
157 _events();
158 _filesystem();
159 _gamepad();
160 _gpu();
161 _guid();
162 _haptic();
163 _hidapi();
164 _hints();
165 _init();
166 _iostream();
167 _joystick();
168 _keyboard();
169 _keycode();
170 _loadso();
171 _locale();
172 _log();
173 _messagebox();
174 _metal();
175 _misc();
176 _mouse();
177 _mutex();
178 _pen();
179 _pixels();
180 _platform();
181 _power();
182 _process();
183 _properties();
184 _rect();
185 _render();
186 _scancode();
187 _sensor();
188 _storage();
189 _surface();
190 _system();
191 _thread();
192 _time();
193 _timer();
194 _tray();
195 _touch();
196 _version();
197 _video();
198 #
199 }
200
201 # No docs because this is a no-op.
202 sub _assert () {
203 state $done++ && return;
204 _error();
205 }
206
207 =head3 C<:asyncio> - Async I/O
208
209 SDL offers a way to perform I/O asynchronously. This allows an app to read or write files without waiting for data to
210 actually transfer; the functions that request I/O never block while the request is fulfilled.
211
212 See L<SDL3: CategoryAsyncIO|https://wiki.libsdl.org/SDL3/CategoryAsyncIO>
213
214 =cut
215
216 sub _asyncio() {
217 state $done++ && return;
218 #
219 _stdinc();
220 #
221 _typedef_and_export SDL_AsyncIO => Void;
222 _enum_and_export SDL_AsyncIOTaskType => [ 'SDL_ASYNCIO_TASK_READ', 'SDL_ASYNCIO_TASK_WRITE', 'SDL_ASYNCIO_TASK_CLOSE' ];
223 _enum_and_export SDL_AsyncIOResult => [ 'SDL_ASYNCIO_COMPLETE', 'SDL_ASYNCIO_FAILURE', 'SDL_ASYNCIO_CANCELED' ];
224 _typedef_and_export SDL_AsyncIOOutcome => Struct [
225 asyncio => Pointer [ SDL_AsyncIO() ],
226 type => SDL_AsyncIOTaskType(),
227 result => SDL_AsyncIOResult(),
228 buffer => Pointer [Void],
229 offset => UInt64,
230 bytes_requested => UInt64,
231 bytes_transferred => UInt64,
232 userdata => Pointer [Void]
233 ];
234 _typedef_and_export SDL_AsyncIOQueue => Void;
235 _affix_and_export SDL_AsyncIOFromFile => [ String, String ], Pointer [ SDL_AsyncIO() ];
236 _affix_and_export SDL_GetAsyncIOSize => [ Pointer [ SDL_AsyncIO() ] ], SInt64;
237 _affix_and_export
238 SDL_ReadAsyncIO => [ Pointer [ SDL_AsyncIO() ], Pointer [Void], UInt64, UInt64, Pointer [ SDL_AsyncIOQueue() ], Pointer [Void] ],
239 Bool;
240 _affix_and_export
241 SDL_WriteAsyncIO => [ Pointer [ SDL_AsyncIO() ], Pointer [Void], UInt64, UInt64, Pointer [ SDL_AsyncIOQueue() ], Pointer [Void] ],
242 Bool;
243 _affix_and_export
244 SDL_CloseAsyncIO => [ Pointer [ SDL_AsyncIO() ], Bool, Pointer [ SDL_AsyncIOQueue() ], Pointer [Void] ],
245 Bool;
246 _affix_and_export SDL_CreateAsyncIOQueue => [], Pointer [ SDL_AsyncIOQueue() ];
247 _affix_and_export SDL_DestroyAsyncIOQueue => [ Pointer [ SDL_AsyncIOQueue() ] ], Void;
248 _affix_and_export SDL_GetAsyncIOResult => [ Pointer [ SDL_AsyncIOQueue() ], Pointer [ SDL_AsyncIOOutcome() ] ], Bool;
249 _affix_and_export
250 SDL_WaitAsyncIOResult => [ Pointer [ SDL_AsyncIOQueue() ], Pointer [ SDL_AsyncIOOutcome() ], SInt32 ],
251 Bool;
252 _affix_and_export SDL_SignalAsyncIOQueue => [ Pointer [ SDL_AsyncIOQueue() ] ], Void;
253 _affix_and_export SDL_LoadFileAsync => [ String, Pointer [ SDL_AsyncIOQueue() ], Pointer [Void] ], Bool;
254 }
255
256 =head3 C<:atomic> - Atomic Operations
257
258 Atomic operations.
259
260 IMPORTANT: If you are not an expert in concurrent lockless programming, you should not be using any functions in this
261 section. You should be protecting your data structures with full mutexes instead.
262
263 See L<SDL3: CategoryAtomic|https://wiki.libsdl.org/SDL3/CategoryAtomic>
264
265 =cut
266
267 sub _atomic () {
268 state $done++ && return;
269 #
270 _platform_defines();
271 _stdinc();
272 #
273 _typedef_and_export SDL_SpinLock => Int;
274 _affix_and_export SDL_TryLockSpinlock => [ Pointer [ SDL_SpinLock() ] ], Bool;
275 _affix_and_export SDL_LockSpinlock => [ Pointer [ SDL_SpinLock() ] ], Void;
276 _affix_and_export SDL_UnlockSpinlock => [ Pointer [ SDL_SpinLock() ] ], Void;
277 _affix_and_export SDL_MemoryBarrierReleaseFunction => [], Void;
278 _affix_and_export SDL_MemoryBarrierAcquireFunction => [], Void;
279 _typedef_and_export SDL_AtomicInt => Struct [ value => Int ];
280 _affix_and_export SDL_CompareAndSwapAtomicInt => [ Pointer [ SDL_AtomicInt() ], Int, Int ], Bool;
281 _affix_and_export SDL_SetAtomicInt => [ Pointer [ SDL_AtomicInt() ], Int ], Int;
282 _affix_and_export SDL_GetAtomicInt => [ Pointer [ SDL_AtomicInt() ] ], Int;
283 _affix_and_export SDL_AddAtomicInt => [ Pointer [ SDL_AtomicInt() ], Int ], Int;
284 _typedef_and_export SDL_AtomicU32 => Struct [ value => UInt32 ];
285 _affix_and_export SDL_CompareAndSwapAtomicU32 => [ Pointer [ SDL_AtomicU32() ], UInt32, UInt32 ], Bool;
286 _affix_and_export SDL_SetAtomicU32 => [ Pointer [ SDL_AtomicU32() ], UInt32 ], UInt32;
287 _affix_and_export SDL_GetAtomicU32 => [ Pointer [ SDL_AtomicU32() ] ], UInt32;
288
289 #~ _affix_and_export SDL_AddAtomicU32 => [ Pointer [ SDL_AtomicU32() ], Int ], UInt32;
290 _affix_and_export SDL_CompareAndSwapAtomicPointer => [ Pointer [ Pointer [Void] ], Pointer [Void], Pointer [Void] ], Bool;
291 _affix_and_export SDL_SetAtomicPointer => [ Pointer [ Pointer [Void] ], Pointer [Void] ], Pointer [Void];
292 _affix_and_export SDL_GetAtomicPointer => [ Pointer [ Pointer [Void] ] ], Pointer [Void];
293 }
294
295 =head3 C<:audio> - Audio Playback, Recording, and Mixing
296
297 Audio functionality for the SDL library.
298
299 All audio in SDL3 revolves around C<SDL_AudioStream>. Whether you want to play or record audio, convert it, stream it,
300 buffer it, or mix it, you're going to be passing it through an audio stream.
301
302 See L<SDL3: CategoryAudio|https://wiki.libsdl.org/SDL3/CategoryAudio>
303
304 =cut
305
306 sub _audio() {
307 state $done++ && return;
308 _error();
309 _iostream();
310 _mutex();
311 _properties();
312 _stdinc();
313 #
314 _const_and_export SDL_AUDIO_MASK_BITSIZE => (0xFF);
315 _const_and_export SDL_AUDIO_MASK_FLOAT => ( 1 << 8 );
316 _const_and_export SDL_AUDIO_MASK_BIG_ENDIAN => ( 1 << 12 );
317 _const_and_export SDL_AUDIO_MASK_SIGNED => ( 1 << 15 );
318 _func_and_export(
319 SDL_DEFINE_AUDIO_FORMAT => sub ( $signed, $bigendian, $flt, $size ) {
320 ( ( ($signed) << 15 ) | ( ($bigendian) << 12 ) | ( ($flt) << 8 ) | ( ($size) & SDL_AUDIO_MASK_BITSIZE() ) )
321 }
322 );
323 _enum_and_export SDL_AudioFormat => [
324 [ SDL_AUDIO_UNKNOWN => 0x0000 ], [ SDL_AUDIO_U8 => 0x0008 ], [ SDL_AUDIO_S8 => 0x8008 ], [ SDL_AUDIO_S16LE => 0x8010 ],
325 [ SDL_AUDIO_S16BE => 0x9010 ], [ SDL_AUDIO_S32LE => 0x8020 ], [ SDL_AUDIO_S32BE => 0x9020 ], [ SDL_AUDIO_F32LE => 0x8120 ],
326 [ SDL_AUDIO_F32BE => 0x9120 ], [ SDL_AUDIO_S16 => 0x8010 ], # Little Endian default?
327 [ SDL_AUDIO_S32 => 0x8020 ], [ SDL_AUDIO_F32 => 0x8120 ]
328 ];
329 _func_and_export( SDL_AUDIO_BITSIZE => sub ($x) { ( ($x) & SDL_AUDIO_MASK_BITSIZE() ) } );
330 _func_and_export( SDL_AUDIO_BYTESIZE => sub ($x) { ( SDL_AUDIO_BITSIZE($x) / 8 ) } );
331 _func_and_export( SDL_AUDIO_ISFLOAT => sub ($x) { ( ($x) & SDL_AUDIO_MASK_FLOAT() ) } );
332 _func_and_export( SDL_AUDIO_ISBIGENDIAN => sub ($x) { ( ($x) & SDL_AUDIO_MASK_BIG_ENDIAN() ) } );
333 _func_and_export( SDL_AUDIO_ISLITTLEENDIAN => sub ($x) { ( !SDL_AUDIO_ISBIGENDIAN($x) ) } );
334 _func_and_export( SDL_AUDIO_ISSIGNED => sub ($x) { ( ($x) & SDL_AUDIO_MASK_SIGNED() ) } );
335 _func_and_export( SDL_AUDIO_ISINT => sub ($x) { ( !SDL_AUDIO_ISFLOAT($x) ) } );
336 _func_and_export( SDL_AUDIO_ISUNSIGNED => sub ($x) { ( !SDL_AUDIO_ISSIGNED($x) ) } );
337 _typedef_and_export SDL_AudioDeviceID => UInt32;
338 _const_and_export SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK => 0xFFFFFFFF;
339 _const_and_export SDL_AUDIO_DEVICE_DEFAULT_RECORDING => 0xFFFFFFFE;
340 _func_and_export( SDL_AUDIO_FRAMESIZE => sub ($x) { ( SDL_AUDIO_BYTESIZE( $x->{format} ) * $x->{channels} ) } );
341 _typedef_and_export SDL_AudioSpec => Struct [ format => SDL_AudioFormat(), channels => Int, freq => Int ];
342 _typedef_and_export SDL_AudioStream => Void;
343 _affix_and_export SDL_GetNumAudioDrivers => [], Int;
344 _affix_and_export SDL_GetAudioDriver => [Int], String;
345 _affix_and_export SDL_GetCurrentAudioDriver => [], String;
346 _affix_and_export SDL_GetAudioPlaybackDevices => [ Pointer [Int] ], Pointer [ SDL_AudioDeviceID() ];
347 _affix_and_export SDL_GetAudioRecordingDevices => [ Pointer [Int] ], Pointer [ SDL_AudioDeviceID() ];
348 _affix_and_export SDL_GetAudioDeviceName => [ SDL_AudioDeviceID() ], String;
349 _affix_and_export SDL_GetAudioDeviceFormat => [ SDL_AudioDeviceID(), Pointer [ SDL_AudioSpec() ], Pointer [Int] ], Bool;
350 _affix_and_export SDL_GetAudioDeviceChannelMap => [ SDL_AudioDeviceID(), Pointer [Int] ], Pointer [Int];
351 _affix_and_export SDL_OpenAudioDevice => [ SDL_AudioDeviceID(), Pointer [ SDL_AudioSpec() ] ], SDL_AudioDeviceID();
352 _affix_and_export SDL_IsAudioDevicePhysical => [ SDL_AudioDeviceID() ], Bool;
353 _affix_and_export SDL_IsAudioDevicePlayback => [ SDL_AudioDeviceID() ], Bool;
354 _affix_and_export SDL_PauseAudioDevice => [ SDL_AudioDeviceID() ], Bool;
355 _affix_and_export SDL_ResumeAudioDevice => [ SDL_AudioDeviceID() ], Bool;
356 _affix_and_export SDL_AudioDevicePaused => [ SDL_AudioDeviceID() ], Bool;
357 _affix_and_export SDL_GetAudioDeviceGain => [ SDL_AudioDeviceID() ], Float;
358 _affix_and_export SDL_SetAudioDeviceGain => [ SDL_AudioDeviceID(), Float ], Bool;
359 _affix_and_export SDL_CloseAudioDevice => [ SDL_AudioDeviceID() ], Void;
360 _affix_and_export SDL_BindAudioStreams => [ SDL_AudioDeviceID(), Pointer [ Pointer [ SDL_AudioStream() ] ], Int ], Bool;
361 _affix_and_export SDL_BindAudioStream => [ SDL_AudioDeviceID(), Pointer [ SDL_AudioStream() ] ], Bool;
362 _affix_and_export SDL_UnbindAudioStreams => [ Pointer [ Pointer [ SDL_AudioStream() ] ], Int ], Void;
363 _affix_and_export SDL_UnbindAudioStream => [ Pointer [ SDL_AudioStream() ] ], Void;
364 _affix_and_export SDL_GetAudioStreamDevice => [ Pointer [ SDL_AudioStream() ] ], SDL_AudioDeviceID();
365 _affix_and_export
366 SDL_CreateAudioStream => [ Pointer [ SDL_AudioSpec() ], Pointer [ SDL_AudioSpec() ] ],
367 Pointer [ SDL_AudioStream() ];
368 _affix_and_export SDL_GetAudioStreamProperties => [ Pointer [ SDL_AudioStream() ] ], SDL_PropertiesID();
369 _const_and_export SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN => 'SDL.audiostream.auto_cleanup';
370 _affix_and_export
371 SDL_GetAudioStreamFormat => [ Pointer [ SDL_AudioStream() ], Pointer [ SDL_AudioSpec() ], Pointer [ SDL_AudioSpec() ] ],
372 Bool;
373 _affix_and_export
374 SDL_SetAudioStreamFormat => [ Pointer [ SDL_AudioStream() ], Pointer [ SDL_AudioSpec() ], Pointer [ SDL_AudioSpec() ] ],
375 Bool;
376 _affix_and_export SDL_GetAudioStreamFrequencyRatio => [ Pointer [ SDL_AudioStream() ] ], Float;
377 _affix_and_export SDL_SetAudioStreamFrequencyRatio => [ Pointer [ SDL_AudioStream() ], Float ], Bool;
378 _affix_and_export SDL_GetAudioStreamGain => [ Pointer [ SDL_AudioStream() ] ], Float;
379 _affix_and_export SDL_SetAudioStreamGain => [ Pointer [ SDL_AudioStream() ], Float ], Bool;
380 _affix_and_export SDL_GetAudioStreamInputChannelMap => [ Pointer [ SDL_AudioStream() ], Pointer [Int] ], Pointer [Int];
381 _affix_and_export SDL_GetAudioStreamOutputChannelMap => [ Pointer [ SDL_AudioStream() ], Pointer [Int] ], Pointer [Int];
382 _affix_and_export SDL_SetAudioStreamInputChannelMap => [ Pointer [ SDL_AudioStream() ], Pointer [Int], Int ], Bool;
383 _affix_and_export SDL_SetAudioStreamOutputChannelMap => [ Pointer [ SDL_AudioStream() ], Pointer [Int], Int ], Bool;
384 _affix_and_export SDL_PutAudioStreamData => [ Pointer [ SDL_AudioStream() ], Pointer [Void], Int ], Bool;
385 _typedef_and_export SDL_AudioStreamDataCompleteCallback => Callback [ [ Pointer [Void], Pointer [Void], Int ] => Void ];
386
387 #~ _affix_and_export
388 #~ SDL_PutAudioStreamDataNoCopy =>
389 #~ [ Pointer [ SDL_AudioStream() ], Pointer [Void], Int, SDL_AudioStreamDataCompleteCallback(), Pointer [Void] ],
390 #~ Bool;
391 #~ _affix_and_export
392 #~ SDL_PutAudioStreamPlanarData => [ Pointer [ SDL_AudioStream() ], Pointer [ Pointer [Void] ], Int, Int ],
393 #~ Bool;
394 _affix_and_export SDL_GetAudioStreamData => [ Pointer [ SDL_AudioStream() ], Pointer [Void], Int ], Int;
395 _affix_and_export SDL_GetAudioStreamAvailable => [ Pointer [ SDL_AudioStream() ] ], Int;
396 _affix_and_export SDL_GetAudioStreamQueued => [ Pointer [ SDL_AudioStream() ] ], Int;
397 _affix_and_export SDL_FlushAudioStream => [ Pointer [ SDL_AudioStream() ] ], Bool;
398 _affix_and_export SDL_ClearAudioStream => [ Pointer [ SDL_AudioStream() ] ], Bool;
399 _affix_and_export SDL_PauseAudioStreamDevice => [ Pointer [ SDL_AudioStream() ] ], Bool;
400 _affix_and_export SDL_ResumeAudioStreamDevice => [ Pointer [ SDL_AudioStream() ] ], Bool;
401 _affix_and_export SDL_AudioStreamDevicePaused => [ Pointer [ SDL_AudioStream() ] ], Bool;
402 _affix_and_export SDL_LockAudioStream => [ Pointer [ SDL_AudioStream() ] ], Bool;
403 _affix_and_export SDL_UnlockAudioStream => [ Pointer [ SDL_AudioStream() ] ], Bool;
404 _typedef_and_export SDL_AudioStreamCallback => Callback [ [ Pointer [Void], Pointer [ SDL_AudioStream() ], Int, Int ] => Void ];
405 _affix_and_export
406 SDL_SetAudioStreamGetCallback => [ Pointer [ SDL_AudioStream() ], SDL_AudioStreamCallback(), Pointer [Void] ],
407 Bool;
408 _affix_and_export
409 SDL_SetAudioStreamPutCallback => [ Pointer [ SDL_AudioStream() ], SDL_AudioStreamCallback(), Pointer [Void] ],
410 Bool;
411 _affix_and_export SDL_DestroyAudioStream => [ Pointer [ SDL_AudioStream() ] ], Void;
412 _affix_and_export
413 SDL_OpenAudioDeviceStream => [ SDL_AudioDeviceID(), Pointer [ SDL_AudioSpec() ], SDL_AudioStreamCallback(), Pointer [Void] ],
414 Pointer [ SDL_AudioStream() ];
415 _typedef_and_export SDL_AudioPostmixCallback => Callback [ [ Pointer [Void], Pointer [ SDL_AudioSpec() ], Pointer [Float], Int ] => Void ];
416 _affix_and_export
417 SDL_SetAudioPostmixCallback => [ SDL_AudioDeviceID(), SDL_AudioPostmixCallback(), Pointer [Void] ],
418 Bool;
419 _affix_and_export
420 SDL_LoadWAV_IO => [ Pointer [ SDL_IOStream() ], Bool, Pointer [ SDL_AudioSpec() ], Pointer [ Pointer [UInt8] ], Pointer [UInt32] ],
421 Bool;
422 _affix_and_export
423 SDL_LoadWAV => [ String, Pointer [ SDL_AudioSpec() ], Pointer [ Pointer [UInt8] ], Pointer [UInt32] ],
424 Bool;
425 _affix_and_export SDL_MixAudio => [ Pointer [UInt8], Pointer [UInt8], SDL_AudioFormat(), UInt32, Float ], Bool;
426 _affix_and_export
427 SDL_ConvertAudioSamples =>
428 [ Pointer [ SDL_AudioSpec() ], Pointer [UInt8], Int, Pointer [ SDL_AudioSpec() ], Pointer [ Pointer [UInt8] ], Pointer [Int] ],
429 Bool;
430 _affix_and_export SDL_GetAudioFormatName => [ SDL_AudioFormat() ], String;
431 _affix_and_export SDL_GetSilenceValueForFormat => [ SDL_AudioFormat() ], Int;
432 }
433
434 =head3 C<:bits> - CategoryBlendmode
435
436 Functions for fiddling with bits and bitmasks.
437
438 See L<SDL3: CategoryBits|https://wiki.libsdl.org/SDL3/CategoryBits>
439
440 =cut
441
442 sub _bits() {
443 state $done++ && return;
444
445 # We don't need this... do we?
446 }
447
448 =head3 C<:blendmode> - Blend modes
449
450 Blend modes decide how two colors will mix together. There are both standard modes for basic needs and a means to
451 create custom modes, dictating what sort of math to do on what color components.
452
453 See L<SDL3: CategoryBlendmode|https://wiki.libsdl.org/SDL3/CategoryBlendmode>
454
455 =cut
456
457 sub _blendmode() { # Based on sdl-main/include/sdl3/sdl_blendmode.h
458 state $done++ && return;
459 #
460 _stdinc();
461 #
462 _typedef_and_export SDL_BlendMode => UInt32;
463 _const_and_export SDL_BLENDMODE_NONE => 0x00000000;
464 _const_and_export SDL_BLENDMODE_BLEND => 0x00000001;
465 _const_and_export SDL_BLENDMODE_BLEND_PREMULTIPLIED => 0x00000010;
466 _const_and_export SDL_BLENDMODE_ADD => 0x00000002;
467 _const_and_export SDL_BLENDMODE_ADD_PREMULTIPLIED => 0x00000020;
468 _const_and_export SDL_BLENDMODE_MOD => 0x00000004;
469 _const_and_export SDL_BLENDMODE_MUL => 0x00000008;
470 _const_and_export SDL_BLENDMODE_INVALID => 0x7FFFFFFF;
471 _enum_and_export SDL_BlendOperation => [
472 [ SDL_BLENDOPERATION_ADD => 0x1 ],
473 [ SDL_BLENDOPERATION_SUBTRACT => 0x2 ],
474 [ SDL_BLENDOPERATION_REV_SUBTRACT => 0x3 ],
475 [ SDL_BLENDOPERATION_MINIMUM => 0x4 ],
476 [ SDL_BLENDOPERATION_MAXIMUM => 0x5 ]
477 ];
478 _enum_and_export SDL_BlendFactor => [
479 [ SDL_BLENDFACTOR_ZERO => 0x1 ],
480 [ SDL_BLENDFACTOR_ONE => 0x2 ],
481 [ SDL_BLENDFACTOR_SRC_COLOR => 0x3 ],
482 [ SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR => 0x4 ],
483 [ SDL_BLENDFACTOR_SRC_ALPHA => 0x5 ],
484 [ SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA => 0x6 ],
485 [ SDL_BLENDFACTOR_DST_COLOR => 0x7 ],
486 [ SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR => 0x8 ],
487 [ SDL_BLENDFACTOR_DST_ALPHA => 0x9 ],
488 [ SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA => 0xA ]
489 ];
490 _affix_and_export
491 SDL_ComposeCustomBlendMode =>
492 [ SDL_BlendFactor(), SDL_BlendFactor(), SDL_BlendOperation(), SDL_BlendFactor(), SDL_BlendFactor(), SDL_BlendOperation() ],
493 SDL_BlendMode();
494 }
495
496 =head3 C<:camera> - Camera Support
497
498 Video capture for the SDL library.
499
500 See L<SDL3: CategoryCamera|https://wiki.libsdl.org/SDL3/CategoryCamera>
501
502 =cut
503
504 sub _camera() {
505 state $done++ && return;
506 #
507 _error();
508 _pixels();
509 _properties();
510 _surface();
511 #
512 _typedef_and_export SDL_CameraID => UInt32;
513 _typedef_and_export SDL_Camera => Void;
514 _typedef_and_export SDL_CameraSpec => Struct [
515 format => SDL_PixelFormat(),
516 colorspace => SDL_Colorspace(),
517 width => Int,
518 height => Int,
519 framerate_numerator => Int,
520 framerate_denominator => Int
521 ];
522 _enum_and_export SDL_CameraPosition =>
523 [ 'SDL_CAMERA_POSITION_UNKNOWN', 'SDL_CAMERA_POSITION_FRONT_FACING', 'SDL_CAMERA_POSITION_BACK_FACING' ];
524 _enum_and_export SDL_CameraPermissionState =>
525 [ [ SDL_CAMERA_PERMISSION_STATE_DENIED => -1 ], 'SDL_CAMERA_PERMISSION_STATE_PENDING', 'SDL_CAMERA_PERMISSION_STATE_APPROVED' ];
526 _affix_and_export SDL_GetNumCameraDrivers => [], Int;
527 _affix_and_export SDL_GetCameraDriver => [Int], String;
528 _affix_and_export SDL_GetCurrentCameraDriver => [], String;
529 _affix_and_export SDL_GetCameras => [ Pointer [Int] ], Pointer [ SDL_CameraID() ];
530 _affix_and_export SDL_GetCameraSupportedFormats => [ SDL_CameraID(), Pointer [Int] ], Pointer [ Pointer [ SDL_CameraSpec() ] ];
531 _affix_and_export SDL_GetCameraName => [ SDL_CameraID() ], String;
532 _affix_and_export SDL_GetCameraPosition => [ SDL_CameraID() ], SDL_CameraPosition();
533 _affix_and_export SDL_OpenCamera => [ SDL_CameraID(), Pointer [ SDL_CameraSpec() ] ], Pointer [ SDL_Camera() ];
534 _affix_and_export SDL_GetCameraPermissionState => [ Pointer [ SDL_Camera() ] ], SDL_CameraPermissionState();
535 _affix_and_export SDL_GetCameraID => [ Pointer [ SDL_Camera() ] ], SDL_CameraID();
536 _affix_and_export SDL_GetCameraProperties => [ Pointer [ SDL_Camera() ] ], SDL_PropertiesID();
537 _affix_and_export SDL_GetCameraFormat => [ Pointer [ SDL_Camera() ], Pointer [ SDL_CameraSpec() ] ], Bool;
538 _affix_and_export SDL_AcquireCameraFrame => [ Pointer [ SDL_Camera() ], Pointer [UInt64] ], Pointer [ SDL_Surface() ];
539 _affix_and_export SDL_ReleaseCameraFrame => [ Pointer [ SDL_Camera() ], Pointer [ SDL_Surface() ] ], Void;
540 _affix_and_export SDL_CloseCamera => [ Pointer [ SDL_Camera() ] ], Void;
541 }
542
543 =head3 C<:clipboard> - Clipboard Handling
544
545 SDL provides access to the system clipboard, both for reading information from other processes and publishing
546 information of its own.
547
548 This is not just text! SDL apps can access and publish data by mimetype.
549
550 See L<SDL3: CategoryClipboard|https://wiki.libsdl.org/SDL3/CategoryClipboard>
551
552 =cut
553
554 sub _clipboard() {
555 state $done++ && return;
556 #
557 _error();
558 _stdinc();
559 #
560 _affix_and_export SDL_SetClipboardText => [String], Bool;
561 _affix_and_export SDL_GetClipboardText => [], String;
562 _affix_and_export SDL_HasClipboardText => [], Bool;
563 _affix_and_export SDL_SetPrimarySelectionText => [String], Bool;
564 _affix_and_export SDL_GetPrimarySelectionText => [], String;
565 _affix_and_export SDL_HasPrimarySelectionText => [], Bool;
566 _typedef_and_export SDL_ClipboardDataCallback => Callback [ [ Pointer [Void], String, Pointer [Size_t] ] => Pointer [Void] ];
567 _typedef_and_export SDL_ClipboardCleanupCallback => Callback [ [ Pointer [Void] ] => Void ];
568 _affix_and_export
569 SDL_SetClipboardData => [ SDL_ClipboardDataCallback(), SDL_ClipboardCleanupCallback(), Pointer [Void], Pointer [String], Size_t ],
570 Bool;
571 _affix_and_export SDL_ClearClipboardData => [], Bool;
572 _affix_and_export SDL_GetClipboardData => [ String, Pointer [Size_t] ], Pointer [Void];
573 _affix_and_export SDL_HasClipboardData => [String], Bool;
574 _affix_and_export SDL_GetClipboardMimeTypes => [ Pointer [Size_t] ], Pointer [String];
575 }
576
577 =head3 C<:cpuinfo> - CPU Feature Detection
578
579 CPU feature detection for SDL.
580
581 These functions are largely concerned with reporting if the system has access to various SIMD instruction sets, but
582 also has other important info to share, such as system RAM size and number of logical CPU cores.
583
584 See L<SDL3: CategoryCPUInfo|https://wiki.libsdl.org/SDL3/CategoryCPUInfo>
585
586 =cut
587
588 sub _cpuinfo() {
589 state $done++ && return;
590 #
591 _stdinc();
592 #
593 _const_and_export SDL_CACHELINE_SIZE => 128;
594 _affix_and_export SDL_GetNumLogicalCPUCores => [], Int;
595 _affix_and_export SDL_GetCPUCacheLineSize => [], Int;
596 _affix_and_export SDL_HasAltiVec => [], Bool;
597 _affix_and_export SDL_HasMMX => [], Bool;
598 _affix_and_export SDL_HasSSE => [], Bool;
599 _affix_and_export SDL_HasSSE2 => [], Bool;
600 _affix_and_export SDL_HasSSE3 => [], Bool;
601 _affix_and_export SDL_HasSSE41 => [], Bool;
602 _affix_and_export SDL_HasSSE42 => [], Bool;
603 _affix_and_export SDL_HasAVX => [], Bool;
604 _affix_and_export SDL_HasAVX2 => [], Bool;
605 _affix_and_export SDL_HasAVX512F => [], Bool;
606 _affix_and_export SDL_HasARMSIMD => [], Bool;
607 _affix_and_export SDL_HasNEON => [], Bool;
608 _affix_and_export SDL_HasLSX => [], Bool;
609 _affix_and_export SDL_HasLASX => [], Bool;
610 _affix_and_export SDL_GetSystemRAM => [], Int;
611 _affix_and_export SDL_GetSIMDAlignment => [], Size_t;
612
613 #~ _affix_and_export SDL_GetSystemPageSize => [], Int;
614 }
615
616 =head3 C<:dialog> - File Dialogs
617
618 File dialog support.
619
620 SDL offers file dialogs, to let users select files with native GUI interfaces. There are "open" dialogs, "save"
621 dialogs, and folder selection dialogs. The app can control some details, such as filtering to specific files, or
622 whether multiple files can be selected by the user.
623
624 Note that launching a file dialog is a non-blocking operation; control returns to the app immediately, and a callback
625 is called later (possibly in another thread) when the user makes a choice.
626
627 See L<SDL3: CategoryDialog|https://wiki.libsdl.org/SDL3/CategoryDialog>
628
629 =cut
630
631 sub _dialog() {
632 state $done++ && return;
633 #
634 _error();
635 _properties();
636 _video();
637 #
638 _typedef_and_export SDL_DialogFileFilter => Struct [ name => String, pattern => String ];
639 _typedef_and_export SDL_DialogFileCallback => Callback [ [ Pointer [Void], Pointer [String], Int ] => Void ];
640 _affix_and_export
641 SDL_ShowOpenFileDialog =>
642 [ SDL_DialogFileCallback(), Pointer [Void], Pointer [ SDL_Window() ], Pointer [ SDL_DialogFileFilter() ], Int, String, Bool ],
643 Void;
644 _affix_and_export
645 SDL_ShowSaveFileDialog =>
646 [ SDL_DialogFileCallback(), Pointer [Void], Pointer [ SDL_Window() ], Pointer [ SDL_DialogFileFilter() ], Int, String ],
647 Void;
648 _affix_and_export
649 SDL_ShowOpenFolderDialog => [ SDL_DialogFileCallback(), Pointer [Void], Pointer [ SDL_Window() ], String, Bool ],
650 Void;
651 _enum_and_export SDL_FileDialogType => [ 'SDL_FILEDIALOG_OPENFILE', 'SDL_FILEDIALOG_SAVEFILE', 'SDL_FILEDIALOG_OPENFOLDER' ];
652 _affix_and_export
653 SDL_ShowFileDialogWithProperties => [ SDL_FileDialogType(), SDL_DialogFileCallback(), Pointer [Void], SDL_PropertiesID() ],
654 Void;
655 _const_and_export SDL_PROP_FILE_DIALOG_FILTERS_POINTER => 'SDL.filedialog.filters';
656 _const_and_export SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER => 'SDL.filedialog.nfilters';
657 _const_and_export SDL_PROP_FILE_DIALOG_WINDOW_POINTER => 'SDL.filedialog.window';
658 _const_and_export SDL_PROP_FILE_DIALOG_LOCATION_STRING => 'SDL.filedialog.location';
659 _const_and_export SDL_PROP_FILE_DIALOG_MANY_BOOLEAN => 'SDL.filedialog.many';
660 _const_and_export SDL_PROP_FILE_DIALOG_TITLE_STRING => 'SDL.filedialog.title';
661 _const_and_export SDL_PROP_FILE_DIALOG_ACCEPT_STRING => 'SDL.filedialog.accept';
662 _const_and_export SDL_PROP_FILE_DIALOG_CANCEL_STRING => 'SDL.filedialog.cancel';
663 }
664
665 =head3 C<:error> - Error Handling
666
667 Simple error message routines for SDL.
668
669 Most apps will interface with these APIs in exactly one function: when almost any SDL function call reports failure,
670 you can get a human-readable string of the problem from L<SDL_GetError()|https://wiki.libsdl.org/SDL3/SDL_GetError>.
671
672 See L<SDL3: CategoryError|https://wiki.libsdl.org/SDL3/CategoryError>
673
674 =cut
675
676 sub _error() {
677 state $done++ && return;
678 #
679 _affix_and_export 'SDL_SetError', [String] => Bool;
680 _affix_and_export 'SDL_OutOfMemory', [] => Bool;
681 _affix_and_export 'SDL_GetError', [] => String;
682 _affix_and_export 'SDL_ClearError', [] => Bool;
683 #
684 _func_and_export( SDL_Unsupported => sub () { SDL_SetError('That operation is not supported') } );
685 _func_and_export( SDL_InvalidParamError => sub ($param) { SDL_SetError( sprintf q[Parameter '%s' is invalid], $param ) } );
686 }
687
688 =head3 C<:events> - Event Handling
689
690 Event queue management.
691
692 See L<SDL3: CategoryEvents|https://wiki.libsdl.org/SDL3/CategoryEvents>
693
694 =cut
695
696 sub _events() {
697 state $done++ && return;
698 _audio();
699 _camera();
700 _error();
701 _gamepad();
702 _joystick();
703 _keyboard();
704 _keycode();
705 _mouse();
706 _pen();
707 _power();
708 _scancode();
709 _sensor();
710 _stdinc();
711 _touch();
712 _video();
713 #
714 _enum_and_export SDL_EventType => [
715 [ SDL_EVENT_FIRST => 0 ], [ SDL_EVENT_QUIT => 0x100 ], 'SDL_EVENT_TERMINATING', 'SDL_EVENT_LOW_MEMORY',
716 'SDL_EVENT_WILL_ENTER_BACKGROUND', 'SDL_EVENT_DID_ENTER_BACKGROUND', 'SDL_EVENT_WILL_ENTER_FOREGROUND', 'SDL_EVENT_DID_ENTER_FOREGROUND',
717 'SDL_EVENT_LOCALE_CHANGED', 'SDL_EVENT_SYSTEM_THEME_CHANGED',
718
719 # Display events
720 # 0x150 was SDL_DISPLAYEVENT, reserve the number for sdl2-compat
721 [ SDL_EVENT_DISPLAY_ORIENTATION => 0x151 ], 'SDL_EVENT_DISPLAY_ADDED', 'SDL_EVENT_DISPLAY_REMOVED', 'SDL_EVENT_DISPLAY_MOVED',
722 'SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED', 'SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED', 'SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED',
723 'SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED', [ SDL_EVENT_DISPLAY_FIRST => 'SDL_EVENT_DISPLAY_ORIENTATION' ],
724 [ SDL_EVENT_DISPLAY_LAST => 'SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED' ],
725
726 # Window events
727 # 0x200 was SDL_WINDOWEVENT, reserve the number for sdl2-compat
728 # 0x201 was SDL_SYSWMEVENT, reserve the number for sdl2-compat
729 [ SDL_EVENT_WINDOW_SHOWN => 0x202 ], 'SDL_EVENT_WINDOW_HIDDEN', 'SDL_EVENT_WINDOW_EXPOSED', 'SDL_EVENT_WINDOW_MOVED',
730 'SDL_EVENT_WINDOW_RESIZED', 'SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED', 'SDL_EVENT_WINDOW_METAL_VIEW_RESIZED', 'SDL_EVENT_WINDOW_MINIMIZED',
731 'SDL_EVENT_WINDOW_MAXIMIZED', 'SDL_EVENT_WINDOW_RESTORED', 'SDL_EVENT_WINDOW_MOUSE_ENTER', 'SDL_EVENT_WINDOW_MOUSE_LEAVE',
732 'SDL_EVENT_WINDOW_FOCUS_GAINED', 'SDL_EVENT_WINDOW_FOCUS_LOST', 'SDL_EVENT_WINDOW_CLOSE_REQUESTED', 'SDL_EVENT_WINDOW_HIT_TEST',
733 'SDL_EVENT_WINDOW_ICCPROF_CHANGED', 'SDL_EVENT_WINDOW_DISPLAY_CHANGED', 'SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED',
734 'SDL_EVENT_WINDOW_SAFE_AREA_CHANGED', 'SDL_EVENT_WINDOW_OCCLUDED', 'SDL_EVENT_WINDOW_ENTER_FULLSCREEN',
735 'SDL_EVENT_WINDOW_LEAVE_FULLSCREEN', 'SDL_EVENT_WINDOW_DESTROYED', 'SDL_EVENT_WINDOW_HDR_STATE_CHANGED',
736 [ SDL_EVENT_WINDOW_FIRST => 'SDL_EVENT_WINDOW_SHOWN' ], [ SDL_EVENT_WINDOW_LAST => 'SDL_EVENT_WINDOW_HDR_STATE_CHANGED' ],
737
738 # Keyboard events
739 [ SDL_EVENT_KEY_DOWN => 0x300 ], 'SDL_EVENT_KEY_UP', 'SDL_EVENT_TEXT_EDITING', 'SDL_EVENT_TEXT_INPUT', 'SDL_EVENT_KEYMAP_CHANGED',
740 'SDL_EVENT_KEYBOARD_ADDED', 'SDL_EVENT_KEYBOARD_REMOVED', 'SDL_EVENT_TEXT_EDITING_CANDIDATES', 'SDL_EVENT_SCREEN_KEYBOARD_SHOWN',
741 'SDL_EVENT_SCREEN_KEYBOARD_HIDDEN',
742
743 # Mouse events
744 [ SDL_EVENT_MOUSE_MOTION => 0x400 ], 'SDL_EVENT_MOUSE_BUTTON_DOWN', 'SDL_EVENT_MOUSE_BUTTON_UP', 'SDL_EVENT_MOUSE_WHEEL',
745 'SDL_EVENT_MOUSE_ADDED', 'SDL_EVENT_MOUSE_REMOVED',
746
747 # Joystick events
748 [ SDL_EVENT_JOYSTICK_AXIS_MOTION => 0x600 ], 'SDL_EVENT_JOYSTICK_BALL_MOTION', 'SDL_EVENT_JOYSTICK_HAT_MOTION',
749 'SDL_EVENT_JOYSTICK_BUTTON_DOWN', 'SDL_EVENT_JOYSTICK_BUTTON_UP', 'SDL_EVENT_JOYSTICK_ADDED', 'SDL_EVENT_JOYSTICK_REMOVED',
750 'SDL_EVENT_JOYSTICK_BATTERY_UPDATED', 'SDL_EVENT_JOYSTICK_UPDATE_COMPLETE',
751
752 # Gamepad events
753 [ SDL_EVENT_GAMEPAD_AXIS_MOTION => 0x650 ], 'SDL_EVENT_GAMEPAD_BUTTON_DOWN', 'SDL_EVENT_GAMEPAD_BUTTON_UP', 'SDL_EVENT_GAMEPAD_ADDED',
754 'SDL_EVENT_GAMEPAD_REMOVED', 'SDL_EVENT_GAMEPAD_REMAPPED', 'SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN', 'SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION',
755 'SDL_EVENT_GAMEPAD_TOUCHPAD_UP', 'SDL_EVENT_GAMEPAD_SENSOR_UPDATE', 'SDL_EVENT_GAMEPAD_UPDATE_COMPLETE',
756 'SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED',
757
758 # Touch events
759 [ SDL_EVENT_FINGER_DOWN => 0x700 ], 'SDL_EVENT_FINGER_UP', 'SDL_EVENT_FINGER_MOTION', 'SDL_EVENT_FINGER_CANCELED',
760
761 # Pinch events
762 [ SDL_EVENT_PINCH_BEGIN => 0x710 ], 'SDL_EVENT_PINCH_UPDATE', 'SDL_EVENT_PINCH_END',
763
764 # 0x800, 0x801, and 0x802 were the Gesture events from SDL2. Do not reuse these values! sdl2-compat needs them!
765 # Clipboard events
766 [ SDL_EVENT_CLIPBOARD_UPDATE => 0x900 ],
767
768 # Drag and drop events
769 [ SDL_EVENT_DROP_FILE => 0x1000 ], 'SDL_EVENT_DROP_TEXT', 'SDL_EVENT_DROP_BEGIN', 'SDL_EVENT_DROP_COMPLETE', 'SDL_EVENT_DROP_POSITION',
770
771 # Audio hotplug events
772 [ SDL_EVENT_AUDIO_DEVICE_ADDED => 0x1100 ], 'SDL_EVENT_AUDIO_DEVICE_REMOVED', 'SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED',
773
774 # Sensor events
775 [ SDL_EVENT_SENSOR_UPDATE => 0x1200 ],
776
777 # Pressure-sensitive pen events
778 [ SDL_EVENT_PEN_PROXIMITY_IN => 0x1300 ], 'SDL_EVENT_PEN_PROXIMITY_OUT', 'SDL_EVENT_PEN_DOWN', 'SDL_EVENT_PEN_UP',
779 'SDL_EVENT_PEN_BUTTON_DOWN', 'SDL_EVENT_PEN_BUTTON_UP', 'SDL_EVENT_PEN_MOTION', 'SDL_EVENT_PEN_AXIS',
780
781 # Camera hotplug events
782 [ SDL_EVENT_CAMERA_DEVICE_ADDED => 0x1400 ], 'SDL_EVENT_CAMERA_DEVICE_REMOVED', 'SDL_EVENT_CAMERA_DEVICE_APPROVED',
783 'SDL_EVENT_CAMERA_DEVICE_DENIED',
784
785 # Render events
786 [ SDL_EVENT_RENDER_TARGETS_RESET => 0x2000 ], 'SDL_EVENT_RENDER_DEVICE_RESET', 'SDL_EVENT_RENDER_DEVICE_LOST',
787
788 # Reserved events for private platforms
789 [ SDL_EVENT_PRIVATE0 => 0x4000 ], 'SDL_EVENT_PRIVATE1', 'SDL_EVENT_PRIVATE2', 'SDL_EVENT_PRIVATE3',
790
791 # Internal events
792 [ SDL_EVENT_POLL_SENTINEL => 0x7F00 ],
793
794 # Events SDL_EVENT_USER through SDL_EVENT_LAST are for your use,
795 # and should be allocated with SDL_RegisterEvents()
796 [ SDL_EVENT_USER => 0x8000 ],
797
798 # This last event is only for bounding internal arrays
799 [ SDL_EVENT_LAST => 0xFFFF ],
800
801 # This just makes sure the enum is the size of Uint32
802 [ SDL_EVENT_ENUM_PADDING => 0x7FFFFFFF ]
803 ];
804 _typedef_and_export SDL_CommonEvent => Struct [ type => UInt32, reserved => UInt32, timestamp => UInt64 ];
805 _typedef_and_export SDL_DisplayEvent => Struct [
806 type => SDL_EventType(),
807 reserved => UInt32,
808 timestamp => UInt64,
809 displayID => SDL_DisplayID(),
810 data1 => SInt32,
811 data2 => SInt32
812 ];
813 _typedef_and_export SDL_WindowEvent =>
814 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, windowID => SDL_WindowID(), data1 => SInt32, data2 => SInt32 ];
815 _typedef_and_export SDL_KeyboardDeviceEvent =>
816 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, which => SDL_KeyboardID() ];
817 _typedef_and_export SDL_KeyboardEvent => Struct [
818 type => SDL_EventType(),
819 reserved => UInt32,
820 timestamp => UInt64,
821 windowID => SDL_WindowID(),
822 which => SDL_KeyboardID(),
823 scancode => SDL_Scancode(),
824 key => SDL_Keycode(),
825 mod => SDL_Keymod(),
826 raw => UInt16,
827 down => Bool,
828 repeat => Bool
829 ];
830 _typedef_and_export SDL_TextEditingEvent => Struct [
831 type => SDL_EventType(),
832 reserved => UInt32,
833 timestamp => UInt64,
834 windowID => SDL_WindowID(),
835 text => String,
836 start => SInt32,
837 length => SInt32
838 ];
839 _typedef_and_export SDL_TextEditingCandidatesEvent => Struct [
840 type => SDL_EventType(),
841 reserved => UInt32,
842 timestamp => UInt64,
843 windowID => SDL_WindowID(),
844 candidates => Pointer [String],
845 num_candidates => SInt32,
846 selected_candidate => SInt32,
847 horizontal => Bool,
848 padding1 => UInt8,
849 padding2 => UInt8,
850 padding3 => UInt8
851 ];
852 _typedef_and_export SDL_TextInputEvent =>
853 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, windowID => SDL_WindowID(), text => String ];
854 _typedef_and_export SDL_MouseDeviceEvent =>
855 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, which => SDL_MouseID() ];
856 _typedef_and_export SDL_MouseMotionEvent => Struct [
857 type => SDL_EventType(),
858 reserved => UInt32,
859 timestamp => UInt64,
860 windowID => SDL_WindowID(),
861 which => SDL_MouseID(),
862 state => SDL_MouseButtonFlags(),
863 x => Float,
864 y => Float,
865 xrel => Float,
866 yrel => Float
867 ];
868 _typedef_and_export SDL_MouseButtonEvent => Struct [
869 type => SDL_EventType(),
870 reserved => UInt32,
871 timestamp => UInt64,
872 windowID => SDL_WindowID(),
873 which => SDL_MouseID(),
874 button => UInt8,
875 down => Bool,
876 clicks => UInt8,
877 padding => UInt8,
878 x => Float,
879 y => Float
880 ];
881 _typedef_and_export SDL_MouseWheelEvent => Struct [
882 type => SDL_EventType(),
883 reserved => UInt32,
884 timestamp => UInt64,
885 windowID => SDL_WindowID(),
886 which => SDL_MouseID(),
887 x => Float,
888 y => Float,
889 direction => SDL_MouseWheelDirection(),
890 mouse_x => Float,
891 mouse_y => Float,
892 integer_x => SInt32,
893 integer_y => SInt32
894 ];
895 _typedef_and_export SDL_JoyAxisEvent => Struct [
896 type => SDL_EventType(),
897 reserved => UInt32,
898 timestamp => UInt64,
899 which => SDL_JoystickID(),
900 axis => UInt8,
901 padding1 => UInt8,
902 padding2 => UInt8,
903 padding3 => UInt8,
904 value => SInt16,
905 padding4 => UInt16
906 ];
907 _typedef_and_export SDL_JoyBallEvent => Struct [
908 type => SDL_EventType(),
909 reserved => UInt32,
910 timestamp => UInt64,
911 which => SDL_JoystickID(),
912 ball => UInt8,
913 padding1 => UInt8,
914 padding2 => UInt8,
915 padding3 => UInt8,
916 xrel => SInt16,
917 yrel => SInt16
918 ];
919 _typedef_and_export SDL_JoyHatEvent => Struct [
920 type => SDL_EventType(),
921 reserved => UInt32,
922 timestamp => UInt64,
923 which => SDL_JoystickID(),
924 hat => UInt8,
925 value => UInt8,
926 padding1 => UInt8,
927 padding2 => UInt8
928 ];
929 _typedef_and_export SDL_JoyButtonEvent => Struct [
930 type => SDL_EventType(),
931 reserved => UInt32,
932 timestamp => UInt64,
933 which => SDL_JoystickID(),
934 button => UInt8,
935 down => Bool,
936 padding1 => UInt8,
937 padding2 => UInt8
938 ];
939 _typedef_and_export SDL_JoyDeviceEvent =>
940 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, which => SDL_JoystickID() ];
941 _typedef_and_export SDL_JoyBatteryEvent => Struct [
942 type => SDL_EventType(),
943 reserved => UInt32,
944 timestamp => UInt64,
945 which => SDL_JoystickID(),
946 state => SDL_PowerState(),
947 percent => Int
948 ];
949 _typedef_and_export SDL_GamepadAxisEvent => Struct [
950 type => SDL_EventType(),
951 reserved => UInt32,
952 timestamp => UInt64,
953 which => SDL_JoystickID(),
954 axis => UInt8,
955 padding1 => UInt8,
956 padding2 => UInt8,
957 padding3 => UInt8,
958 value => SInt16,
959 padding4 => UInt16
960 ];
961 _typedef_and_export SDL_GamepadButtonEvent => Struct [
962 type => SDL_EventType(),
963 reserved => UInt32,
964 timestamp => UInt64,
965 which => SDL_JoystickID(),
966 button => UInt8,
967 down => Bool,
968 padding1 => UInt8,
969 padding2 => UInt8
970 ];
971 _typedef_and_export SDL_GamepadDeviceEvent =>
972 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, which => SDL_JoystickID() ];
973 _typedef_and_export SDL_GamepadTouchpadEvent => Struct [
974 type => SDL_EventType(),
975 reserved => UInt32,
976 timestamp => UInt64,
977 which => SDL_JoystickID(),
978 touchpad => SInt32,
979 finger => SInt32,
980 x => Float,
981 y => Float,
982 pressure => Float
983 ];
984 _typedef_and_export SDL_GamepadSensorEvent => Struct [
985 type => SDL_EventType(),
986 reserved => UInt32,
987 timestamp => UInt64,
988 which => SDL_JoystickID(),
989 sensor => SInt32,
990 data => Array [ Float, 3 ],
991 sensor_timestamp => UInt64
992 ];
993 _typedef_and_export SDL_AudioDeviceEvent => Struct [
994 type => SDL_EventType(),
995 reserved => UInt32,
996 timestamp => UInt64,
997 which => SDL_AudioDeviceID(),
998 recording => Bool,
999 padding1 => UInt8,
1000 padding2 => UInt8,
1001 padding3 => UInt8
1002 ];
1003 _typedef_and_export SDL_CameraDeviceEvent =>
1004 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, which => SDL_CameraID() ];
1005 _typedef_and_export SDL_RenderEvent =>
1006 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, windowID => SDL_WindowID() ];
1007 _typedef_and_export SDL_TouchFingerEvent => Struct [
1008 type => SDL_EventType(),
1009 reserved => UInt32,
1010 timestamp => UInt64,
1011 touchID => SDL_TouchID(),
1012 fingerID => SDL_FingerID(),
1013 x => Float,
1014 y => Float,
1015 dx => Float,
1016 dy => Float,
1017 pressure => Float,
1018 windowID => SDL_WindowID()
1019 ];
1020 _typedef_and_export SDL_PinchFingerEvent =>
1021 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, scale => Float, windowID => SDL_WindowID() ];
1022 _typedef_and_export SDL_PenProximityEvent =>
1023 Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64, windowID => SDL_WindowID(), which => SDL_PenID() ];
1024 _typedef_and_export SDL_PenMotionEvent => Struct [
1025 type => SDL_EventType(),
1026 reserved => UInt32,
1027 timestamp => UInt64,
1028 windowID => SDL_WindowID(),
1029 which => SDL_PenID(),
1030 pen_state => SDL_PenInputFlags(),
1031 x => Float,
1032 y => Float
1033 ];
1034 _typedef_and_export SDL_PenTouchEvent => Struct [
1035 type => SDL_EventType(),
1036 reserved => UInt32,
1037 timestamp => UInt64,
1038 windowID => SDL_WindowID(),
1039 which => SDL_PenID(),
1040 pen_state => SDL_PenInputFlags(),
1041 x => Float,
1042 y => Float,
1043 eraser => Bool,
1044 down => Bool
1045 ];
1046 _typedef_and_export SDL_PenButtonEvent => Struct [
1047 type => SDL_EventType(),
1048 reserved => UInt32,
1049 timestamp => UInt64,
1050 windowID => SDL_WindowID(),
1051 which => SDL_PenID(),
1052 pen_state => SDL_PenInputFlags(),
1053 x => Float,
1054 y => Float,
1055 button => UInt8,
1056 down => Bool
1057 ];
1058 _typedef_and_export SDL_PenAxisEvent => Struct [
1059 type => SDL_EventType(),
1060 reserved => UInt32,
1061 timestamp => UInt64,
1062 windowID => SDL_WindowID(),
1063 which => SDL_PenID(),
1064 pen_state => SDL_PenInputFlags(),
1065 x => Float,
1066 y => Float,
1067 axis => SDL_PenAxis(),
1068 value => Float
1069 ];
1070 _typedef_and_export SDL_DropEvent => Struct [
1071 type => SDL_EventType(),
1072 reserved => UInt32,
1073 timestamp => UInt64,
1074 windowID => SDL_WindowID(),
1075 x => Float,
1076 y => Float,
1077 source => String,
1078 data => String
1079 ];
1080 _typedef_and_export SDL_ClipboardEvent => Struct [
1081 type => SDL_EventType(),
1082 reserved => UInt32,
1083 timestamp => UInt64,
1084 owner => Bool,
1085 num_mime_types => SInt32,
1086 mime_types => Pointer [String]
1087 ];
1088 _typedef_and_export SDL_SensorEvent => Struct [
1089 type => SDL_EventType(),
1090 reserved => UInt32,
1091 timestamp => UInt64,
1092 which => SDL_SensorID(),
1093 data => Array [ Float, 6 ],
1094 sensor_timestamp => UInt64
1095 ];
1096 _typedef_and_export SDL_QuitEvent => Struct [ type => SDL_EventType(), reserved => UInt32, timestamp => UInt64 ];
1097 _typedef_and_export SDL_UserEvent => Struct [
1098 type => UInt32,
1099 reserved => UInt32,
1100 timestamp => UInt64,
1101 windowID => SDL_WindowID(),
1102 code => SInt32,
1103 data1 => Pointer [Void],
1104 data2 => Pointer [Void]
1105 ];
1106 _typedef_and_export SDL_Event => Union [
1107 type => UInt32,
1108 common => SDL_CommonEvent(),
1109 display => SDL_DisplayEvent(),
1110 window => SDL_WindowEvent(),
1111 kdevice => SDL_KeyboardDeviceEvent(),
1112 key => SDL_KeyboardEvent(),
1113 edit => SDL_TextEditingEvent(),
1114 edit_candidates => SDL_TextEditingCandidatesEvent(),
1115 text => SDL_TextInputEvent(),
1116 mdevice => SDL_MouseDeviceEvent(),
1117 motion => SDL_MouseMotionEvent(),
1118 button => SDL_MouseButtonEvent(),
1119 wheel => SDL_MouseWheelEvent(),
1120 jdevice => SDL_JoyDeviceEvent(),
1121 jaxis => SDL_JoyAxisEvent(),
1122 jball => SDL_JoyBallEvent(),
1123 jhat => SDL_JoyHatEvent(),
1124 jbutton => SDL_JoyButtonEvent(),
1125 jbattery => SDL_JoyBatteryEvent(),
1126 gdevice => SDL_GamepadDeviceEvent(),
1127 gaxis => SDL_GamepadAxisEvent(),
1128 gbutton => SDL_GamepadButtonEvent(),
1129 gtouchpad => SDL_GamepadTouchpadEvent(),
1130 gsensor => SDL_GamepadSensorEvent(),
1131 adevice => SDL_AudioDeviceEvent(),
1132 cdevice => SDL_CameraDeviceEvent(),
1133 sensor => SDL_SensorEvent(),
1134 quit => SDL_QuitEvent(),
1135 user => SDL_UserEvent(),
1136 tfinger => SDL_TouchFingerEvent(),
1137 pinch => SDL_PinchFingerEvent(),
1138 pproximity => SDL_PenProximityEvent(),
1139 ptouch => SDL_PenTouchEvent(),
1140 pmotion => SDL_PenMotionEvent(),
1141 pbutton => SDL_PenButtonEvent(),
1142 paxis => SDL_PenAxisEvent(),
1143 render => SDL_RenderEvent(),
1144 drop => SDL_DropEvent(),
1145 clipboard => SDL_ClipboardEvent(),
1146 padding => Array [ UInt8, 128 ]
1147 ];
1148 _affix_and_export SDL_PumpEvents => [], Void;
1149 _enum_and_export SDL_EventAction => [ 'SDL_ADDEVENT', 'SDL_PEEKEVENT', 'SDL_GETEVENT' ];
1150 _affix_and_export SDL_PeepEvents => [ Pointer [ SDL_Event() ], Int, SDL_EventAction(), UInt32, UInt32 ], Int;
1151 _affix_and_export SDL_HasEvent => [UInt32], Bool;
1152 _affix_and_export SDL_HasEvents => [ UInt32, UInt32 ], Bool;
1153 _affix_and_export SDL_FlushEvent => [UInt32], Void;
1154 _affix_and_export SDL_FlushEvents => [ UInt32, UInt32 ], Void;
1155 _affix_and_export SDL_PollEvent => [ Pointer [ SDL_Event() ] ], Bool;
1156 _affix_and_export SDL_WaitEvent => [ Pointer [ SDL_Event() ] ], Bool;
1157 _affix_and_export SDL_WaitEventTimeout => [ Pointer [ SDL_Event() ], SInt32 ], Bool;
1158 _affix_and_export SDL_PushEvent => [ Pointer [ SDL_Event() ] ], Bool;
1159 _typedef_and_export SDL_EventFilter => Callback [ [ Pointer [Void], Pointer [ SDL_Event() ] ] => Bool ];
1160 _affix_and_export SDL_SetEventFilter => [ SDL_EventFilter(), Pointer [Void] ], Void;
1161 _affix_and_export SDL_GetEventFilter => [ Pointer [ SDL_EventFilter() ], Pointer [ Pointer [Void] ] ], Bool;
1162 _affix_and_export SDL_AddEventWatch => [ SDL_EventFilter(), Pointer [Void] ], Bool;
1163 _affix_and_export SDL_RemoveEventWatch => [ SDL_EventFilter(), Pointer [Void] ], Void;
1164 _affix_and_export SDL_FilterEvents => [ SDL_EventFilter(), Pointer [Void] ], Void;
1165 _affix_and_export SDL_SetEventEnabled => [ UInt32, Bool ], Void;
1166 _affix_and_export SDL_EventEnabled => [UInt32], Bool;
1167 _affix_and_export SDL_RegisterEvents => [Int], UInt32;
1168 _affix_and_export SDL_GetWindowFromEvent => [ Pointer [ SDL_Event() ] ], Pointer [ SDL_Window() ];
1169
1170 #~ _affix_and_export SDL_GetEventDescription => [ Pointer [ SDL_Event() ], String, Int ], Int;
1171 }
1172
1173 =head3 C<:filesystem> - Filesystem Access
1174
1175 SDL offers an API for examining and manipulating the system's filesystem. This covers most things one would need to do
1176 with directories, except for actual file I/O.
1177
1178 See L<SDL3: CategoryFilesystem|https://wiki.libsdl.org/SDL3/CategoryFilesystem>
1179
1180 =cut
1181
1182 sub _filesystem() {
1183 state $done++ && return;
1184 #
1185 _error();
1186 _stdinc();
1187 #
1188 _affix_and_export SDL_GetBasePath => [], String;
1189 _affix_and_export SDL_GetPrefPath => [ String, String ], String;
1190 _enum_and_export SDL_Folder => [
1191 'SDL_FOLDER_HOME', 'SDL_FOLDER_DESKTOP', 'SDL_FOLDER_DOCUMENTS', 'SDL_FOLDER_DOWNLOADS',
1192 'SDL_FOLDER_MUSIC', 'SDL_FOLDER_PICTURES', 'SDL_FOLDER_PUBLICSHARE', 'SDL_FOLDER_SAVEDGAMES',
1193 'SDL_FOLDER_SCREENSHOTS', 'SDL_FOLDER_TEMPLATES', 'SDL_FOLDER_VIDEOS', 'SDL_FOLDER_COUNT'
1194 ];
1195 _affix_and_export SDL_GetUserFolder => [ SDL_Folder() ], String;
1196 _enum_and_export SDL_PathType => [ 'SDL_PATHTYPE_NONE', 'SDL_PATHTYPE_FILE', 'SDL_PATHTYPE_DIRECTORY', 'SDL_PATHTYPE_OTHER' ];
1197 _typedef_and_export SDL_PathInfo => Struct [
1198 type => SDL_PathType(),
1199 size => UInt64,
1200 create_time => SInt64, # SDL_Time
1201 modify_time => SInt64,
1202 access_time => SInt64
1203 ];
1204 _typedef_and_export SDL_GlobFlags => UInt32;
1205 _const_and_export SDL_GLOB_CASEINSENSITIVE => ( 1 << 0 );
1206 _affix_and_export SDL_CreateDirectory => [String], Bool;
1207 _enum_and_export SDL_EnumerationResult => [ 'SDL_ENUM_CONTINUE', 'SDL_ENUM_SUCCESS', 'SDL_ENUM_FAILURE' ];
1208 _typedef_and_export SDL_EnumerateDirectoryCallback => Callback [ [ Pointer [Void], String, String ] => SDL_EnumerationResult() ];
1209 _affix_and_export
1210 SDL_EnumerateDirectory => [ String, SDL_EnumerateDirectoryCallback(), Pointer [Void] ],
1211 Bool;
1212 _affix_and_export SDL_RemovePath => [String], Bool;
1213 _affix_and_export SDL_RenamePath => [ String, String ], Bool;
1214 _affix_and_export SDL_CopyFile => [ String, String ], Bool;
1215 _affix_and_export SDL_GetPathInfo => [ String, Pointer [ SDL_PathInfo() ] ], Bool;
1216 _affix_and_export
1217 SDL_GlobDirectory => [ String, String, SDL_GlobFlags(), Pointer [Int] ],
1218 Pointer [String];
1219 _affix_and_export SDL_GetCurrentDirectory => [], String;
1220 }
1221
1222 =head3 C<:gamepad> - Gamepad Support
1223
1224 SDL provides a low-level joystick API, which just treats joysticks as an arbitrary pile of buttons, axes, and hat
1225 switches. If you're planning to write your own control configuration screen, this can give you a lot of flexibility,
1226 but that's a lot of work, and most things that we consider "joysticks" now are actually console-style gamepads. So SDL
1227 provides the gamepad API on top of the lower-level joystick functionality.
1228
1229 See L<SDL3: CategoryGamepad|https://wiki.libsdl.org/SDL3/CategoryGamepad>
1230
1231 =cut
1232
1233 sub _gamepad() {
1234 state $done++ && return;
1235 #
1236 _error();
1237 _guid();
1238 _iostream();
1239 _joystick();
1240 _power();
1241 _properties();
1242 _sensor();
1243 _stdinc();
1244 #
1245 _typedef_and_export SDL_Gamepad => Void;
1246 _enum_and_export SDL_GamepadType => [
1247 'SDL_GAMEPAD_TYPE_UNKNOWN', 'SDL_GAMEPAD_TYPE_STANDARD',
1248 'SDL_GAMEPAD_TYPE_XBOX360', 'SDL_GAMEPAD_TYPE_XBOXONE',
1249 'SDL_GAMEPAD_TYPE_PS3', 'SDL_GAMEPAD_TYPE_PS4',
1250 'SDL_GAMEPAD_TYPE_PS5', 'SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO',
1251 'SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT', 'SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT',
1252 'SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR', 'SDL_GAMEPAD_TYPE_GAMECUBE',
1253 'SDL_GAMEPAD_TYPE_COUNT'
1254 ];
1255 _enum_and_export SDL_GamepadButton => [
1256 [ SDL_GAMEPAD_BUTTON_INVALID => -1 ], 'SDL_GAMEPAD_BUTTON_SOUTH',
1257 'SDL_GAMEPAD_BUTTON_EAST', 'SDL_GAMEPAD_BUTTON_WEST',
1258 'SDL_GAMEPAD_BUTTON_NORTH', 'SDL_GAMEPAD_BUTTON_BACK',
1259 'SDL_GAMEPAD_BUTTON_GUIDE', 'SDL_GAMEPAD_BUTTON_START',
1260 'SDL_GAMEPAD_BUTTON_LEFT_STICK', 'SDL_GAMEPAD_BUTTON_RIGHT_STICK',
1261 'SDL_GAMEPAD_BUTTON_LEFT_SHOULDER', 'SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER',
1262 'SDL_GAMEPAD_BUTTON_DPAD_UP', 'SDL_GAMEPAD_BUTTON_DPAD_DOWN',
1263 'SDL_GAMEPAD_BUTTON_DPAD_LEFT', 'SDL_GAMEPAD_BUTTON_DPAD_RIGHT',
1264 'SDL_GAMEPAD_BUTTON_MISC1', 'SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1',
1265 'SDL_GAMEPAD_BUTTON_LEFT_PADDLE1', 'SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2',
1266 'SDL_GAMEPAD_BUTTON_LEFT_PADDLE2', 'SDL_GAMEPAD_BUTTON_TOUCHPAD',
1267 'SDL_GAMEPAD_BUTTON_MISC2', 'SDL_GAMEPAD_BUTTON_MISC3',
1268 'SDL_GAMEPAD_BUTTON_MISC4', 'SDL_GAMEPAD_BUTTON_MISC5',
1269 'SDL_GAMEPAD_BUTTON_MISC6', 'SDL_GAMEPAD_BUTTON_COUNT'
1270 ];
1271 _enum_and_export SDL_GamepadButtonLabel => [
1272 'SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN', 'SDL_GAMEPAD_BUTTON_LABEL_A',
1273 'SDL_GAMEPAD_BUTTON_LABEL_B', 'SDL_GAMEPAD_BUTTON_LABEL_X',
1274 'SDL_GAMEPAD_BUTTON_LABEL_Y', 'SDL_GAMEPAD_BUTTON_LABEL_CROSS',
1275 'SDL_GAMEPAD_BUTTON_LABEL_CIRCLE', 'SDL_GAMEPAD_BUTTON_LABEL_SQUARE',
1276 'SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE'
1277 ];
1278 _enum_and_export SDL_GamepadAxis => [
1279 [ SDL_GAMEPAD_AXIS_INVALID => -1 ], 'SDL_GAMEPAD_AXIS_LEFTX',
1280 'SDL_GAMEPAD_AXIS_LEFTY', 'SDL_GAMEPAD_AXIS_RIGHTX',
1281 'SDL_GAMEPAD_AXIS_RIGHTY', 'SDL_GAMEPAD_AXIS_LEFT_TRIGGER',
1282 'SDL_GAMEPAD_AXIS_RIGHT_TRIGGER', 'SDL_GAMEPAD_AXIS_COUNT'
1283 ];
1284 _enum_and_export SDL_GamepadBindingType =>
1285 [ 'SDL_GAMEPAD_BINDTYPE_NONE', 'SDL_GAMEPAD_BINDTYPE_BUTTON', 'SDL_GAMEPAD_BINDTYPE_AXIS', 'SDL_GAMEPAD_BINDTYPE_HAT' ];
1286 _typedef_and_export SDL_GamepadBinding => Struct [
1287 input_type => SDL_GamepadBindingType(),
1288 input => Union [
1289 button => Int,
1290 axis => Struct [ axis => Int, axis_min => Int, axis_max => Int ],
1291 hat => Struct [ hat => Int, hat_mask => Int ]
1292 ],
1293 output_type => SDL_GamepadBindingType(),
1294 output => Union [ button => SDL_GamepadButton(), axis => Struct [ axis => SDL_GamepadAxis(), axis_min => Int, axis_max => Int ] ]
1295 ];
1296 _affix_and_export SDL_AddGamepadMapping => [String], Int;
1297 _affix_and_export SDL_AddGamepadMappingsFromIO => [ Pointer [ SDL_IOStream() ], Bool ], Int;
1298 _affix_and_export SDL_AddGamepadMappingsFromFile => [String], Int;
1299 _affix_and_export SDL_ReloadGamepadMappings => [], Bool;
1300 _affix_and_export SDL_GetGamepadMappings => [ Pointer [Int] ], Pointer [String];
1301 _affix_and_export SDL_GetGamepadMappingForGUID => [ SDL_GUID() ], String;
1302 _affix_and_export SDL_GetGamepadMapping => [ Pointer [ SDL_Gamepad() ] ], String;
1303 _affix_and_export SDL_SetGamepadMapping => [ SDL_JoystickID(), String ], Bool;
1304 _affix_and_export SDL_HasGamepad => [], Bool;
1305 _affix_and_export SDL_GetGamepads => [ Pointer [Int] ], Pointer [ SDL_JoystickID() ];
1306 _affix_and_export SDL_IsGamepad => [ SDL_JoystickID() ], Bool;
1307 _affix_and_export SDL_GetGamepadNameForID => [ SDL_JoystickID() ], String;
1308 _affix_and_export SDL_GetGamepadPathForID => [ SDL_JoystickID() ], String;
1309 _affix_and_export SDL_GetGamepadPlayerIndexForID => [ SDL_JoystickID() ], Int;
1310 _affix_and_export SDL_GetGamepadGUIDForID => [ SDL_JoystickID() ], SDL_GUID();
1311 _affix_and_export SDL_GetGamepadVendorForID => [ SDL_JoystickID() ], UInt16;
1312 _affix_and_export SDL_GetGamepadProductForID => [ SDL_JoystickID() ], UInt16;
1313 _affix_and_export SDL_GetGamepadProductVersionForID => [ SDL_JoystickID() ], UInt16;
1314 _affix_and_export SDL_GetGamepadTypeForID => [ SDL_JoystickID() ], SDL_GamepadType();
1315 _affix_and_export SDL_GetRealGamepadTypeForID => [ SDL_JoystickID() ], SDL_GamepadType();
1316 _affix_and_export SDL_GetGamepadMappingForID => [ SDL_JoystickID() ], String;
1317 _affix_and_export SDL_OpenGamepad => [ SDL_JoystickID() ], Pointer [ SDL_Gamepad() ];
1318 _affix_and_export SDL_GetGamepadFromID => [ SDL_JoystickID() ], Pointer [ SDL_Gamepad() ];
1319 _affix_and_export SDL_GetGamepadFromPlayerIndex => [Int], Pointer [ SDL_Gamepad() ];
1320 _affix_and_export SDL_GetGamepadProperties => [ Pointer [ SDL_Gamepad() ] ], SDL_PropertiesID();
1321 _const_and_export SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN => 'SDL.joystick.cap.mono_led';
1322 _const_and_export SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN => 'SDL.joystick.cap.rgb_led';
1323 _const_and_export SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN => 'SDL.joystick.cap.player_led';
1324 _const_and_export SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN => 'SDL.joystick.cap.rumble';
1325 _const_and_export SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN => 'SDL.joystick.cap.trigger_rumble';
1326 _affix_and_export SDL_GetGamepadID => [ Pointer [ SDL_Gamepad() ] ], SDL_JoystickID();
1327 _affix_and_export SDL_GetGamepadName => [ Pointer [ SDL_Gamepad() ] ], String;
1328 _affix_and_export SDL_GetGamepadPath => [ Pointer [ SDL_Gamepad() ] ], String;
1329 _affix_and_export SDL_GetGamepadType => [ Pointer [ SDL_Gamepad() ] ], SDL_GamepadType();
1330 _affix_and_export SDL_GetRealGamepadType => [ Pointer [ SDL_Gamepad() ] ], SDL_GamepadType();
1331 _affix_and_export SDL_GetGamepadPlayerIndex => [ Pointer [ SDL_Gamepad() ] ], Int;
1332 _affix_and_export SDL_SetGamepadPlayerIndex => [ Pointer [ SDL_Gamepad() ], Int ], Bool;
1333 _affix_and_export SDL_GetGamepadVendor => [ Pointer [ SDL_Gamepad() ] ], UInt16;
1334 _affix_and_export SDL_GetGamepadProduct => [ Pointer [ SDL_Gamepad() ] ], UInt16;
1335 _affix_and_export SDL_GetGamepadProductVersion => [ Pointer [ SDL_Gamepad() ] ], UInt16;
1336 _affix_and_export SDL_GetGamepadFirmwareVersion => [ Pointer [ SDL_Gamepad() ] ], UInt16;
1337 _affix_and_export SDL_GetGamepadSerial => [ Pointer [ SDL_Gamepad() ] ], String;
1338 _affix_and_export SDL_GetGamepadSteamHandle => [ Pointer [ SDL_Gamepad() ] ], UInt64;
1339 _affix_and_export SDL_GetGamepadConnectionState => [ Pointer [ SDL_Gamepad() ] ], SDL_JoystickConnectionState();
1340 _affix_and_export SDL_GetGamepadPowerInfo => [ Pointer [ SDL_Gamepad() ], Pointer [Int] ], SDL_PowerState();
1341 _affix_and_export SDL_GamepadConnected => [ Pointer [ SDL_Gamepad() ] ], Bool;
1342 _affix_and_export SDL_GetGamepadJoystick => [ Pointer [ SDL_Gamepad() ] ], Pointer [ SDL_Joystick() ];
1343 _affix_and_export SDL_SetGamepadEventsEnabled => [Bool], Void;
1344 _affix_and_export SDL_GamepadEventsEnabled => [], Bool;
1345 _affix_and_export
1346 SDL_GetGamepadBindings => [ Pointer [ SDL_Gamepad() ], Pointer [Int] ],
1347 Pointer [ Pointer [ SDL_GamepadBinding() ] ];
1348 _affix_and_export SDL_UpdateGamepads => [], Void;
1349 _affix_and_export SDL_GetGamepadTypeFromString => [String], SDL_GamepadType();
1350 _affix_and_export SDL_GetGamepadStringForType => [ SDL_GamepadType() ], String;
1351 _affix_and_export SDL_GetGamepadAxisFromString => [String], SDL_GamepadAxis();
1352 _affix_and_export SDL_GetGamepadStringForAxis => [ SDL_GamepadAxis() ], String;
1353 _affix_and_export SDL_GamepadHasAxis => [ Pointer [ SDL_Gamepad() ], SDL_GamepadAxis() ], Bool;
1354 _affix_and_export SDL_GetGamepadAxis => [ Pointer [ SDL_Gamepad() ], SDL_GamepadAxis() ], SInt16;
1355 _affix_and_export SDL_GetGamepadButtonFromString => [String], SDL_GamepadButton();
1356 _affix_and_export SDL_GetGamepadStringForButton => [ SDL_GamepadButton() ], String;
1357 _affix_and_export SDL_GamepadHasButton => [ Pointer [ SDL_Gamepad() ], SDL_GamepadButton() ], Bool;
1358 _affix_and_export SDL_GetGamepadButton => [ Pointer [ SDL_Gamepad() ], SDL_GamepadButton() ], Bool;
1359 _affix_and_export SDL_GetGamepadButtonLabelForType => [ SDL_GamepadType(), SDL_GamepadButton() ], SDL_GamepadButtonLabel();
1360 _affix_and_export SDL_GetGamepadButtonLabel => [ Pointer [ SDL_Gamepad() ], SDL_GamepadButton() ], SDL_GamepadButtonLabel();
1361 _affix_and_export SDL_GetNumGamepadTouchpads => [ Pointer [ SDL_Gamepad() ] ], Int;
1362 _affix_and_export SDL_GetNumGamepadTouchpadFingers => [ Pointer [ SDL_Gamepad() ], Int ], Int;
1363 _affix_and_export
1364 SDL_GetGamepadTouchpadFinger =>
1365 [ Pointer [ SDL_Gamepad() ], Int, Int, Pointer [Bool], Pointer [Float], Pointer [Float], Pointer [Float] ],
1366 Bool;
1367 _affix_and_export SDL_GamepadHasSensor => [ Pointer [ SDL_Gamepad() ], SDL_SensorType() ], Bool;
1368 _affix_and_export SDL_SetGamepadSensorEnabled => [ Pointer [ SDL_Gamepad() ], SDL_SensorType(), Bool ], Bool;
1369 _affix_and_export SDL_GamepadSensorEnabled => [ Pointer [ SDL_Gamepad() ], SDL_SensorType() ], Bool;
1370 _affix_and_export SDL_GetGamepadSensorDataRate => [ Pointer [ SDL_Gamepad() ], SDL_SensorType() ], Float;
1371 _affix_and_export SDL_GetGamepadSensorData => [ Pointer [ SDL_Gamepad() ], SDL_SensorType(), Pointer [Float], Int ], Bool;
1372 _affix_and_export SDL_RumbleGamepad => [ Pointer [ SDL_Gamepad() ], UInt16, UInt16, UInt32 ], Bool;
1373 _affix_and_export SDL_RumbleGamepadTriggers => [ Pointer [ SDL_Gamepad() ], UInt16, UInt16, UInt32 ], Bool;
1374 _affix_and_export SDL_SetGamepadLED => [ Pointer [ SDL_Gamepad() ], UInt8, UInt8, UInt8 ], Bool;
1375 _affix_and_export SDL_SendGamepadEffect => [ Pointer [ SDL_Gamepad() ], Pointer [Void], Int ], Bool;
1376 _affix_and_export SDL_CloseGamepad => [ Pointer [ SDL_Gamepad() ] ], Void;
1377 _affix_and_export SDL_GetGamepadAppleSFSymbolsNameForButton => [ Pointer [ SDL_Gamepad() ], SDL_GamepadButton() ], String;
1378 _affix_and_export SDL_GetGamepadAppleSFSymbolsNameForAxis => [ Pointer [ SDL_Gamepad() ], SDL_GamepadAxis() ], String;
1379 }
1380
1381 =head3 C<:gpu> - 3D Rendering and GPU Compute
1382
1383 The GPU API offers a cross-platform way for apps to talk to modern graphics hardware. It offers both 3D graphics and
1384 compute support, in the style of Metal, Vulkan, and Direct3D 12.
1385
1386 See L<SDL3: CategoryGPU|https://wiki.libsdl.org/SDL3/CategoryGPU>
1387
1388 =cut
1389
1390 sub _gpu() {
1391 state $done++ && return;
1392 #
1393 _pixels();
1394 _properties();
1395 _rect();
1396 _stdinc();
1397 _surface();
1398 _video();
1399 #
1400 _typedef_and_export SDL_GPUDevice => Void;
1401 _typedef_and_export SDL_GPUBuffer => Void;
1402 _typedef_and_export SDL_GPUTransferBuffer => Void;
1403 _typedef_and_export SDL_GPUTexture => Void;
1404 _typedef_and_export SDL_GPUSampler => Void;
1405 _typedef_and_export SDL_GPUShader => Void;
1406 _typedef_and_export SDL_GPUComputePipeline => Void;
1407 _typedef_and_export SDL_GPUGraphicsPipeline => Void;
1408 _typedef_and_export SDL_GPUCommandBuffer => Void;
1409 _typedef_and_export SDL_GPURenderPass => Void;
1410 _typedef_and_export SDL_GPUComputePass => Void;
1411 _typedef_and_export SDL_GPUCopyPass => Void;
1412 _typedef_and_export SDL_GPUFence => Void;
1413 _enum_and_export SDL_GPUPrimitiveType => [
1414 'SDL_GPU_PRIMITIVETYPE_TRIANGLELIST', 'SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP',
1415 'SDL_GPU_PRIMITIVETYPE_LINELIST', 'SDL_GPU_PRIMITIVETYPE_LINESTRIP',
1416 'SDL_GPU_PRIMITIVETYPE_POINTLIST'
1417 ];
1418 _enum_and_export SDL_GPULoadOp => [ 'SDL_GPU_LOADOP_LOAD', 'SDL_GPU_LOADOP_CLEAR', 'SDL_GPU_LOADOP_DONT_CARE' ];
1419 _enum_and_export SDL_GPUStoreOp =>
1420 [ 'SDL_GPU_STOREOP_STORE', 'SDL_GPU_STOREOP_DONT_CARE', 'SDL_GPU_STOREOP_RESOLVE', 'SDL_GPU_STOREOP_RESOLVE_AND_STORE' ];
1421 _enum_and_export SDL_GPUIndexElementSize => [ 'SDL_GPU_INDEXELEMENTSIZE_16BIT', 'SDL_GPU_INDEXELEMENTSIZE_32BIT' ];
1422 _enum_and_export SDL_GPUTextureFormat => [
1423 'SDL_GPU_TEXTUREFORMAT_INVALID', 'SDL_GPU_TEXTUREFORMAT_A8_UNORM',
1424 'SDL_GPU_TEXTUREFORMAT_R8_UNORM', 'SDL_GPU_TEXTUREFORMAT_R8G8_UNORM',
1425 'SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM', 'SDL_GPU_TEXTUREFORMAT_R16_UNORM',
1426 'SDL_GPU_TEXTUREFORMAT_R16G16_UNORM', 'SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM',
1427 'SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM', 'SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM',
1428 'SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM', 'SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM',
1429 'SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM', 'SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM',
1430 'SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM', 'SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM',
1431 'SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM', 'SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM',
1432 'SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM', 'SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT',
1433 'SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT', 'SDL_GPU_TEXTUREFORMAT_R8_SNORM',
1434 'SDL_GPU_TEXTUREFORMAT_R8G8_SNORM', 'SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM',
1435 'SDL_GPU_TEXTUREFORMAT_R16_SNORM', 'SDL_GPU_TEXTUREFORMAT_R16G16_SNORM',
1436 'SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM', 'SDL_GPU_TEXTUREFORMAT_R16_FLOAT',
1437 'SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT', 'SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT',
1438 'SDL_GPU_TEXTUREFORMAT_R32_FLOAT', 'SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT',
1439 'SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT', 'SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT',
1440 'SDL_GPU_TEXTUREFORMAT_R8_UINT', 'SDL_GPU_TEXTUREFORMAT_R8G8_UINT',
1441 'SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT', 'SDL_GPU_TEXTUREFORMAT_R16_UINT',
1442 'SDL_GPU_TEXTUREFORMAT_R16G16_UINT', 'SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT',
1443 'SDL_GPU_TEXTUREFORMAT_R32_UINT', 'SDL_GPU_TEXTUREFORMAT_R32G32_UINT',
1444 'SDL_GPU_TEXTUREFORMAT_R32G32B32A32_UINT', 'SDL_GPU_TEXTUREFORMAT_R8_INT',
1445 'SDL_GPU_TEXTUREFORMAT_R8G8_INT', 'SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT',
1446 'SDL_GPU_TEXTUREFORMAT_R16_INT', 'SDL_GPU_TEXTUREFORMAT_R16G16_INT',
1447 'SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT', 'SDL_GPU_TEXTUREFORMAT_R32_INT',
1448 'SDL_GPU_TEXTUREFORMAT_R32G32_INT', 'SDL_GPU_TEXTUREFORMAT_R32G32B32A32_INT',
1449 'SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB',
1450 'SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB',
1451 'SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB',
1452 'SDL_GPU_TEXTUREFORMAT_D16_UNORM', 'SDL_GPU_TEXTUREFORMAT_D24_UNORM',
1453 'SDL_GPU_TEXTUREFORMAT_D32_FLOAT', 'SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT',
1454 'SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT', 'SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM',
1455 'SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM', 'SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM',
1456 'SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM', 'SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM',
1457 'SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM', 'SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM',
1458 'SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM', 'SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM',
1459 'SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM', 'SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM',
1460 'SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM', 'SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM',
1461 'SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM', 'SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB',
1462 'SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB',
1463 'SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB',
1464 'SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB',
1465 'SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB',
1466 'SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB',
1467 'SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB',
1468 'SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB', 'SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT',
1469 'SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT', 'SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT',
1470 'SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT', 'SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT',
1471 'SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT', 'SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT',
1472 'SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT', 'SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT',
1473 'SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT', 'SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT',
1474 'SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT', 'SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT',
1475 'SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT'
1476 ];
1477 _typedef_and_export SDL_GPUTextureUsageFlags => UInt32;
1478 _const_and_export SDL_GPU_TEXTUREUSAGE_SAMPLER => ( 1 << 0 );
1479 _const_and_export SDL_GPU_TEXTUREUSAGE_COLOR_TARGET => ( 1 << 1 );
1480 _const_and_export SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET => ( 1 << 2 );
1481 _const_and_export SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ => ( 1 << 3 );
1482 _const_and_export SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ => ( 1 << 4 );
1483 _const_and_export SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE => ( 1 << 5 );
1484 _const_and_export SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE => ( 1 << 6 );
1485 _enum_and_export SDL_GPUTextureType => [
1486 'SDL_GPU_TEXTURETYPE_2D', 'SDL_GPU_TEXTURETYPE_2D_ARRAY', 'SDL_GPU_TEXTURETYPE_3D', 'SDL_GPU_TEXTURETYPE_CUBE',
1487 'SDL_GPU_TEXTURETYPE_CUBE_ARRAY'
1488 ];
1489 _enum_and_export SDL_GPUSampleCount => [ 'SDL_GPU_SAMPLECOUNT_1', 'SDL_GPU_SAMPLECOUNT_2', 'SDL_GPU_SAMPLECOUNT_4', 'SDL_GPU_SAMPLECOUNT_8' ];
1490 _enum_and_export SDL_GPUCubeMapFace => [
1491 'SDL_GPU_CUBEMAPFACE_POSITIVEX', 'SDL_GPU_CUBEMAPFACE_NEGATIVEX', 'SDL_GPU_CUBEMAPFACE_POSITIVEY', 'SDL_GPU_CUBEMAPFACE_NEGATIVEY',
1492 'SDL_GPU_CUBEMAPFACE_POSITIVEZ', 'SDL_GPU_CUBEMAPFACE_NEGATIVEZ'
1493 ];
1494 _typedef_and_export SDL_GPUBufferUsageFlags => UInt32;
1495 _const_and_export SDL_GPU_BUFFERUSAGE_VERTEX => ( 1 << 0 );
1496 _const_and_export SDL_GPU_BUFFERUSAGE_INDEX => ( 1 << 1 );
1497 _const_and_export SDL_GPU_BUFFERUSAGE_INDIRECT => ( 1 << 2 );
1498 _const_and_export SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ => ( 1 << 3 );
1499 _const_and_export SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ => ( 1 << 4 );
1500 _const_and_export SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE => ( 1 << 5 );
1501 _enum_and_export SDL_GPUTransferBufferUsage => [ 'SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD', 'SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD' ];
1502 _enum_and_export SDL_GPUShaderStage => [ 'SDL_GPU_SHADERSTAGE_VERTEX', 'SDL_GPU_SHADERSTAGE_FRAGMENT' ];
1503 _typedef_and_export SDL_GPUShaderFormat => UInt32;
1504 _const_and_export SDL_GPU_SHADERFORMAT_INVALID => 0;
1505 _const_and_export SDL_GPU_SHADERFORMAT_PRIVATE => ( 1 << 0 );
1506 _const_and_export SDL_GPU_SHADERFORMAT_SPIRV => ( 1 << 1 );
1507 _const_and_export SDL_GPU_SHADERFORMAT_DXBC => ( 1 << 2 );
1508 _const_and_export SDL_GPU_SHADERFORMAT_DXIL => ( 1 << 3 );
1509 _const_and_export SDL_GPU_SHADERFORMAT_MSL => ( 1 << 4 );
1510 _const_and_export SDL_GPU_SHADERFORMAT_METALLIB => ( 1 << 5 );
1511 _enum_and_export SDL_GPUVertexElementFormat => [
1512 'SDL_GPU_VERTEXELEMENTFORMAT_INVALID', 'SDL_GPU_VERTEXELEMENTFORMAT_INT',
1513 'SDL_GPU_VERTEXELEMENTFORMAT_INT2', 'SDL_GPU_VERTEXELEMENTFORMAT_INT3',
1514 'SDL_GPU_VERTEXELEMENTFORMAT_INT4', 'SDL_GPU_VERTEXELEMENTFORMAT_UINT',
1515 'SDL_GPU_VERTEXELEMENTFORMAT_UINT2', 'SDL_GPU_VERTEXELEMENTFORMAT_UINT3',
1516 'SDL_GPU_VERTEXELEMENTFORMAT_UINT4', 'SDL_GPU_VERTEXELEMENTFORMAT_FLOAT',
1517 'SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2', 'SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3',
1518 'SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4', 'SDL_GPU_VERTEXELEMENTFORMAT_BYTE2',
1519 'SDL_GPU_VERTEXELEMENTFORMAT_BYTE4', 'SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2',
1520 'SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4', 'SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM',
1521 'SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM', 'SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM',
1522 'SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM', 'SDL_GPU_VERTEXELEMENTFORMAT_SHORT2',
1523 'SDL_GPU_VERTEXELEMENTFORMAT_SHORT4', 'SDL_GPU_VERTEXELEMENTFORMAT_USHORT2',
1524 'SDL_GPU_VERTEXELEMENTFORMAT_USHORT4', 'SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM',
1525 'SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM', 'SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM',
1526 'SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM', 'SDL_GPU_VERTEXELEMENTFORMAT_HALF2',
1527 'SDL_GPU_VERTEXELEMENTFORMAT_HALF4'
1528 ];
1529 _enum_and_export SDL_GPUVertexInputRate => [ 'SDL_GPU_VERTEXINPUTRATE_VERTEX', 'SDL_GPU_VERTEXINPUTRATE_INSTANCE' ];
1530 _enum_and_export SDL_GPUFillMode => [ 'SDL_GPU_FILLMODE_FILL', 'SDL_GPU_FILLMODE_LINE' ];
1531 _enum_and_export SDL_GPUCullMode => [ 'SDL_GPU_CULLMODE_NONE', 'SDL_GPU_CULLMODE_FRONT', 'SDL_GPU_CULLMODE_BACK' ];
1532 _enum_and_export SDL_GPUFrontFace => [ 'SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE', 'SDL_GPU_FRONTFACE_CLOCKWISE' ];
1533 _enum_and_export SDL_GPUCompareOp => [
1534 'SDL_GPU_COMPAREOP_INVALID', 'SDL_GPU_COMPAREOP_NEVER',
1535 'SDL_GPU_COMPAREOP_LESS', 'SDL_GPU_COMPAREOP_EQUAL',
1536 'SDL_GPU_COMPAREOP_LESS_OR_EQUAL', 'SDL_GPU_COMPAREOP_GREATER',
1537 'SDL_GPU_COMPAREOP_NOT_EQUAL', 'SDL_GPU_COMPAREOP_GREATER_OR_EQUAL',
1538 'SDL_GPU_COMPAREOP_ALWAYS'
1539 ];
1540 _enum_and_export SDL_GPUStencilOp => [
1541 'SDL_GPU_STENCILOP_INVALID', 'SDL_GPU_STENCILOP_KEEP',
1542 'SDL_GPU_STENCILOP_ZERO', 'SDL_GPU_STENCILOP_REPLACE',
1543 'SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP', 'SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP',
1544 'SDL_GPU_STENCILOP_INVERT', 'SDL_GPU_STENCILOP_INCREMENT_AND_WRAP',
1545 'SDL_GPU_STENCILOP_DECREMENT_AND_WRAP'
1546 ];
1547 _enum_and_export SDL_GPUBlendOp => [
1548 'SDL_GPU_BLENDOP_INVALID', 'SDL_GPU_BLENDOP_ADD', 'SDL_GPU_BLENDOP_SUBTRACT', 'SDL_GPU_BLENDOP_REVERSE_SUBTRACT',
1549 'SDL_GPU_BLENDOP_MIN', 'SDL_GPU_BLENDOP_MAX'
1550 ];
1551 _enum_and_export SDL_GPUBlendFactor => [
1552 'SDL_GPU_BLENDFACTOR_INVALID', 'SDL_GPU_BLENDFACTOR_ZERO',
1553 'SDL_GPU_BLENDFACTOR_ONE', 'SDL_GPU_BLENDFACTOR_SRC_COLOR',
1554 'SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR', 'SDL_GPU_BLENDFACTOR_DST_COLOR',
1555 'SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR', 'SDL_GPU_BLENDFACTOR_SRC_ALPHA',
1556 'SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA', 'SDL_GPU_BLENDFACTOR_DST_ALPHA',
1557 'SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA', 'SDL_GPU_BLENDFACTOR_CONSTANT_COLOR',
1558 'SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR', 'SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE'
1559 ];
1560 _typedef_and_export SDL_GPUColorComponentFlags => UInt8;
1561 _const_and_export SDL_GPU_COLORCOMPONENT_R => ( 1 << 0 );
1562 _const_and_export SDL_GPU_COLORCOMPONENT_G => ( 1 << 1 );
1563 _const_and_export SDL_GPU_COLORCOMPONENT_B => ( 1 << 2 );
1564 _const_and_export SDL_GPU_COLORCOMPONENT_A => ( 1 << 3 );
1565 _enum_and_export SDL_GPUFilter => [ 'SDL_GPU_FILTER_NEAREST', 'SDL_GPU_FILTER_LINEAR' ];
1566 _enum_and_export SDL_GPUSamplerMipmapMode => [ 'SDL_GPU_SAMPLERMIPMAPMODE_NEAREST', 'SDL_GPU_SAMPLERMIPMAPMODE_LINEAR' ];
1567 _enum_and_export SDL_GPUSamplerAddressMode =>
1568 [ 'SDL_GPU_SAMPLERADDRESSMODE_REPEAT', 'SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT', 'SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE' ];
1569 _enum_and_export SDL_GPUPresentMode => [ 'SDL_GPU_PRESENTMODE_VSYNC', 'SDL_GPU_PRESENTMODE_IMMEDIATE', 'SDL_GPU_PRESENTMODE_MAILBOX' ];
1570 _enum_and_export SDL_GPUSwapchainComposition => [
1571 'SDL_GPU_SWAPCHAINCOMPOSITION_SDR', 'SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR',
1572 'SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR', 'SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084'
1573 ];
1574 _typedef_and_export SDL_GPUViewport => Struct [ x => Float, y => Float, w => Float, h => Float, min_depth => Float, max_depth => Float ];
1575 _typedef_and_export SDL_GPUTextureTransferInfo =>
1576 Struct [ transfer_buffer => Pointer [ SDL_GPUTransferBuffer() ], offset => UInt32, pixels_per_row => UInt32, rows_per_layer => UInt32 ];
1577 _typedef_and_export SDL_GPUTransferBufferLocation => Struct [ transfer_buffer => Pointer [ SDL_GPUTransferBuffer() ], offset => UInt32 ];
1578 _typedef_and_export SDL_GPUTextureLocation =>
1579 Struct [ texture => Pointer [ SDL_GPUTexture() ], mip_level => UInt32, layer => UInt32, x => UInt32, y => UInt32, z => UInt32 ];
1580 _typedef_and_export SDL_GPUTextureRegion => Struct [
1581 texture => Pointer [ SDL_GPUTexture() ],
1582 mip_level => UInt32,
1583 layer => UInt32,
1584 x => UInt32,
1585 y => UInt32,
1586 z => UInt32,
1587 w => UInt32,
1588 h => UInt32,
1589 d => UInt32
1590 ];
1591 _typedef_and_export SDL_GPUBlitRegion => Struct [
1592 texture => Pointer [ SDL_GPUTexture() ],
1593 mip_level => UInt32,
1594 layer_or_depth_plane => UInt32,
1595 x => UInt32,
1596 y => UInt32,
1597 w => UInt32,
1598 h => UInt32
1599 ];
1600 _typedef_and_export SDL_GPUBufferLocation => Struct [ buffer => Pointer [ SDL_GPUBuffer() ], offset => UInt32 ];
1601 _typedef_and_export SDL_GPUBufferRegion => Struct [ buffer => Pointer [ SDL_GPUBuffer() ], offset => UInt32, size => UInt32 ];
1602 _typedef_and_export SDL_GPUIndirectDrawCommand =>
1603 Struct [ num_vertices => UInt32, num_instances => UInt32, first_vertex => UInt32, first_instance => UInt32 ];
1604 _typedef_and_export SDL_GPUIndexedIndirectDrawCommand =>
1605 Struct [ num_indices => UInt32, num_instances => UInt32, first_index => UInt32, vertex_offset => SInt32, first_instance => UInt32 ];
1606 _typedef_and_export SDL_GPUIndirectDispatchCommand => Struct [ groupcount_x => UInt32, groupcount_y => UInt32, groupcount_z => UInt32 ];
1607 _typedef_and_export SDL_GPUSamplerCreateInfo => Struct [
1608 min_filter => SDL_GPUFilter(),
1609 mag_filter => SDL_GPUFilter(),
1610 mipmap_mode => SDL_GPUSamplerMipmapMode(),
1611 address_mode_u => SDL_GPUSamplerAddressMode(),
1612 address_mode_v => SDL_GPUSamplerAddressMode(),
1613 address_mode_w => SDL_GPUSamplerAddressMode(),
1614 mip_lod_bias => Float,
1615 max_anisotropy => Float,
1616 compare_op => SDL_GPUCompareOp(),
1617 min_lod => Float,
1618 max_lod => Float,
1619 enable_anisotropy => Bool,
1620 enable_compare => Bool,
1621 padding1 => UInt8,
1622 padding2 => UInt8,
1623 props => SDL_PropertiesID()
1624 ];
1625 _typedef_and_export SDL_GPUVertexBufferDescription =>
1626 Struct [ slot => UInt32, pitch => UInt32, input_rate => SDL_GPUVertexInputRate(), instance_step_rate => UInt32 ];
1627 _typedef_and_export SDL_GPUVertexAttribute =>
1628 Struct [ location => UInt32, buffer_slot => UInt32, format => SDL_GPUVertexElementFormat(), offset => UInt32 ];
1629 _typedef_and_export SDL_GPUVertexInputState => Struct [
1630 vertex_buffer_descriptions => Pointer [ SDL_GPUVertexBufferDescription() ],
1631 num_vertex_buffers => UInt32,
1632 vertex_attributes => Pointer [ SDL_GPUVertexAttribute() ],
1633 num_vertex_attributes => UInt32
1634 ];
1635 _typedef_and_export SDL_GPUStencilOpState => Struct [
1636 fail_op => SDL_GPUStencilOp(),
1637 pass_op => SDL_GPUStencilOp(),
1638 depth_fail_op => SDL_GPUStencilOp(),
1639 compare_op => SDL_GPUCompareOp()
1640 ];
1641 _typedef_and_export SDL_GPUColorTargetBlendState => Struct [
1642 src_color_blendfactor => SDL_GPUBlendFactor(),
1643 dst_color_blendfactor => SDL_GPUBlendFactor(),
1644 color_blend_op => SDL_GPUBlendOp(),
1645 src_alpha_blendfactor => SDL_GPUBlendFactor(),
1646 dst_alpha_blendfactor => SDL_GPUBlendFactor(),
1647 alpha_blend_op => SDL_GPUBlendOp(),
1648 color_write_mask => SDL_GPUColorComponentFlags(),
1649 enable_blend => Bool,
1650 enable_color_write_mask => Bool,
1651 padding1 => UInt8,
1652 padding2 => UInt8
1653 ];
1654 _typedef_and_export SDL_GPUShaderCreateInfo => Struct [
1655 code_size => Size_t,
1656 code => Pointer [UInt8],
1657 entrypoint => String,
1658 format => SDL_GPUShaderFormat(),
1659 stage => SDL_GPUShaderStage(),
1660 num_samplers => UInt32,
1661 num_storage_textures => UInt32,
1662 num_storage_buffers => UInt32,
1663 num_uniform_buffers => UInt32,
1664 props => SDL_PropertiesID()
1665 ];
1666 _typedef_and_export SDL_GPUTextureCreateInfo => Struct [
1667 type => SDL_GPUTextureType(),
1668 format => SDL_GPUTextureFormat(),
1669 usage => SDL_GPUTextureUsageFlags(),
1670 width => UInt32,
1671 height => UInt32,
1672 layer_count_or_depth => UInt32,
1673 num_levels => UInt32,
1674 sample_count => SDL_GPUSampleCount(),
1675 props => SDL_PropertiesID()
1676 ];
1677 _typedef_and_export SDL_GPUBufferCreateInfo => Struct [ usage => SDL_GPUBufferUsageFlags(), size => UInt32, props => SDL_PropertiesID() ];
1678 _typedef_and_export SDL_GPUTransferBufferCreateInfo =>
1679 Struct [ usage => SDL_GPUTransferBufferUsage(), size => UInt32, props => SDL_PropertiesID() ];
1680 _typedef_and_export SDL_GPURasterizerState => Struct [
1681 fill_mode => SDL_GPUFillMode(),
1682 cull_mode => SDL_GPUCullMode(),
1683 front_face => SDL_GPUFrontFace(),
1684 depth_bias_constant_factor => Float,
1685 depth_bias_clamp => Float,
1686 depth_bias_slope_factor => Float,
1687 enable_depth_bias => Bool,
1688 enable_depth_clip => Bool,
1689 padding1 => UInt8,
1690 padding2 => UInt8
1691 ];
1692 _typedef_and_export SDL_GPUMultisampleState => Struct [
1693 sample_count => SDL_GPUSampleCount(),
1694 sample_mask => UInt32,
1695 enable_mask => Bool,
1696 enable_alpha_to_coverage => Bool,
1697 padding2 => UInt8,
1698 padding3 => UInt8
1699 ];
1700 _typedef_and_export SDL_GPUDepthStencilState => Struct [
1701 compare_op => SDL_GPUCompareOp(),
1702 back_stencil_state => SDL_GPUStencilOpState(),
1703 front_stencil_state => SDL_GPUStencilOpState(),
1704 compare_mask => UInt8,
1705 write_mask => UInt8,
1706 enable_depth_test => Bool,
1707 enable_depth_write => Bool,
1708 enable_stencil_test => Bool,
1709 padding1 => UInt8,
1710 padding2 => UInt8,
1711 padding3 => UInt8
1712 ];
1713 _typedef_and_export SDL_GPUColorTargetDescription =>
1714 Struct [ format => SDL_GPUTextureFormat(), blend_state => SDL_GPUColorTargetBlendState() ];
1715 _typedef_and_export SDL_GPUGraphicsPipelineTargetInfo => Struct [
1716 color_target_descriptions => Pointer [ SDL_GPUColorTargetDescription() ],
1717 num_color_targets => UInt32,
1718 depth_stencil_format => SDL_GPUTextureFormat(),
1719 has_depth_stencil_target => Bool,
1720 padding1 => UInt8,
1721 padding2 => UInt8,
1722 padding3 => UInt8
1723 ];
1724 _typedef_and_export SDL_GPUGraphicsPipelineCreateInfo => Struct [
1725 vertex_shader => Pointer [ SDL_GPUShader() ],
1726 fragment_shader => Pointer [ SDL_GPUShader() ],
1727 vertex_input_state => SDL_GPUVertexInputState(),
1728 primitive_type => SDL_GPUPrimitiveType(),
1729 rasterizer_state => SDL_GPURasterizerState(),
1730 multisample_state => SDL_GPUMultisampleState(),
1731 depth_stencil_state => SDL_GPUDepthStencilState(),
1732 target_info => SDL_GPUGraphicsPipelineTargetInfo(),
1733 props => SDL_PropertiesID()
1734 ];
1735 _typedef_and_export SDL_GPUComputePipelineCreateInfo => Struct [
1736 code_size => Size_t,
1737 code => Pointer [UInt8],
1738 entrypoint => String,
1739 format => SDL_GPUShaderFormat(),
1740 num_samplers => UInt32,
1741 num_readonly_storage_textures => UInt32,
1742 num_readonly_storage_buffers => UInt32,
1743 num_readwrite_storage_textures => UInt32,
1744 num_readwrite_storage_buffers => UInt32,
1745 num_uniform_buffers => UInt32,
1746 threadcount_x => UInt32,
1747 threadcount_y => UInt32,
1748 threadcount_z => UInt32,
1749 props => SDL_PropertiesID()
1750 ];
1751 _typedef_and_export SDL_GPUColorTargetInfo => Struct [
1752 texture => Pointer [ SDL_GPUTexture() ],
1753 mip_level => UInt32,
1754 layer_or_depth_plane => UInt32,
1755 clear_color => SDL_FColor(),
1756 load_op => SDL_GPULoadOp(),
1757 store_op => SDL_GPUStoreOp(),
1758 resolve_texture => Pointer [ SDL_GPUTexture() ],
1759 resolve_mip_level => UInt32,
1760 resolve_layer => UInt32,
1761 cycle => Bool,
1762 cycle_resolve_texture => Bool,
1763 padding1 => UInt8,
1764 padding2 => UInt8
1765 ];
1766 _typedef_and_export SDL_GPUDepthStencilTargetInfo => Struct [
1767 texture => Pointer [ SDL_GPUTexture() ],
1768 clear_depth => Float,
1769 load_op => SDL_GPULoadOp(),
1770 store_op => SDL_GPUStoreOp(),
1771 stencil_load_op => SDL_GPULoadOp(),
1772 stencil_store_op => SDL_GPUStoreOp(),
1773 cycle => Bool,
1774 clear_stencil => UInt8,
1775 mip_level => UInt8,
1776 layer => UInt8
1777 ];
1778 _typedef_and_export SDL_GPUBlitInfo => Struct [
1779 source => SDL_GPUBlitRegion(),
1780 destination => SDL_GPUBlitRegion(),
1781 load_op => SDL_GPULoadOp(),
1782 clear_color => SDL_FColor(),
1783 flip_mode => SDL_FlipMode(),
1784 filter => SDL_GPUFilter(),
1785 cycle => Bool,
1786 padding1 => UInt8,
1787 padding2 => UInt8,
1788 padding3 => UInt8
1789 ];
1790 _typedef_and_export SDL_GPUBufferBinding => Struct [ buffer => Pointer [ SDL_GPUBuffer() ], offset => UInt32 ];
1791 _typedef_and_export SDL_GPUTextureSamplerBinding =>
1792 Struct [ texture => Pointer [ SDL_GPUTexture() ], sampler => Pointer [ SDL_GPUSampler() ] ];
1793 _typedef_and_export SDL_GPUStorageBufferReadWriteBinding =>
1794 Struct [ buffer => Pointer [ SDL_GPUBuffer() ], cycle => Bool, padding1 => UInt8, padding2 => UInt8, padding3 => UInt8 ];
1795 _typedef_and_export SDL_GPUStorageTextureReadWriteBinding => Struct [
1796 texture => Pointer [ SDL_GPUTexture() ],
1797 mip_level => UInt32,
1798 layer => UInt32,
1799 cycle => Bool,
1800 padding1 => UInt8,
1801 padding2 => UInt8,
1802 padding3 => UInt8
1803 ];
1804 _affix_and_export SDL_GPUSupportsShaderFormats => [ SDL_GPUShaderFormat(), String ], Bool;
1805 _affix_and_export SDL_GPUSupportsProperties => [ SDL_PropertiesID() ], Bool;
1806 _affix_and_export SDL_CreateGPUDevice => [ SDL_GPUShaderFormat(), Bool, String ], Pointer [ SDL_GPUDevice() ];
1807 _affix_and_export SDL_CreateGPUDeviceWithProperties => [ SDL_PropertiesID() ], Pointer [ SDL_GPUDevice() ];
1808 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN => 'SDL.gpu.device.create.debugmode';
1809 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN => 'SDL.gpu.device.create.preferlowpower';
1810 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_VERBOSE_BOOLEAN => 'SDL.gpu.device.create.verbose';
1811 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING => 'SDL.gpu.device.create.name';
1812 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_FEATURE_CLIP_DISTANCE_BOOLEAN => 'SDL.gpu.device.create.feature.clip_distance';
1813 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN => 'SDL.gpu.device.create.feature.depth_clamping';
1814 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_FEATURE_INDIRECT_DRAW_FIRST_INSTANCE_BOOLEAN =>
1815 'SDL.gpu.device.create.feature.indirect_draw_first_instance';
1816 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_FEATURE_ANISOTROPY_BOOLEAN => 'SDL.gpu.device.create.feature.anisotropy';
1817 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN => 'SDL.gpu.device.create.shaders.private';
1818 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN => 'SDL.gpu.device.create.shaders.spirv';
1819 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN => 'SDL.gpu.device.create.shaders.dxbc';
1820 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN => 'SDL.gpu.device.create.shaders.dxil';
1821 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN => 'SDL.gpu.device.create.shaders.msl';
1822 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN => 'SDL.gpu.device.create.shaders.metallib';
1823 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN =>
1824 'SDL.gpu.device.create.d3d12.allowtier1resourcebinding';
1825 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING => 'SDL.gpu.device.create.d3d12.semantic';
1826 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN =>
1827 'SDL.gpu.device.create.vulkan.requirehardwareacceleration';
1828 _const_and_export SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER => 'SDL.gpu.device.create.vulkan.options';
1829 _typedef_and_export SDL_GPUVulkanOptions => Struct [
1830 vulkan_api_version => UInt32,
1831 feature_list => Pointer [Void],
1832 vulkan_10_physical_device_features => Pointer [Void],
1833 device_extension_count => UInt32,
1834 device_extension_names => Pointer [String],
1835 instance_extension_count => UInt32,
1836 instance_extension_names => Pointer [String]
1837 ];
1838 _affix_and_export SDL_DestroyGPUDevice => [ Pointer [ SDL_GPUDevice() ] ], Void;
1839 _affix_and_export SDL_GetNumGPUDrivers => [], Int;
1840 _affix_and_export SDL_GetGPUDriver => [Int], String;
1841 _affix_and_export SDL_GetGPUDeviceDriver => [ Pointer [ SDL_GPUDevice() ] ], String;
1842 _affix_and_export SDL_GetGPUShaderFormats => [ Pointer [ SDL_GPUDevice() ] ], SDL_GPUShaderFormat();
1843
1844 #~ _affix_and_export SDL_GetGPUDeviceProperties => [ Pointer [ SDL_GPUDevice() ] ], SDL_PropertiesID();
1845 _const_and_export SDL_PROP_GPU_DEVICE_NAME_STRING => 'SDL.gpu.device.name';
1846 _const_and_export SDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING => 'SDL.gpu.device.driver_name';
1847 _const_and_export SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING => 'SDL.gpu.device.driver_version';
1848 _const_and_export SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING => 'SDL.gpu.device.driver_info';
1849 _affix_and_export
1850 SDL_CreateGPUComputePipeline => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUComputePipelineCreateInfo() ] ],
1851 Pointer [ SDL_GPUComputePipeline() ];
1852 _const_and_export SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING => 'SDL.gpu.computepipeline.create.name';
1853 _affix_and_export
1854 SDL_CreateGPUGraphicsPipeline => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUGraphicsPipelineCreateInfo() ] ],
1855 Pointer [ SDL_GPUGraphicsPipeline() ];
1856 _const_and_export SDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING => 'SDL.gpu.graphicspipeline.create.name';
1857 _affix_and_export
1858 SDL_CreateGPUSampler => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUSamplerCreateInfo() ] ],
1859 Pointer [ SDL_GPUSampler() ];
1860 _const_and_export SDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING => 'SDL.gpu.sampler.create.name';
1861 _affix_and_export SDL_CreateGPUShader => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUShaderCreateInfo() ] ], Pointer [ SDL_GPUShader() ];
1862 _const_and_export SDL_PROP_GPU_SHADER_CREATE_NAME_STRING => 'SDL.gpu.shader.create.name';
1863 _affix_and_export
1864 SDL_CreateGPUTexture => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUTextureCreateInfo() ] ],
1865 Pointer [ SDL_GPUTexture() ];
1866 _const_and_export SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT => 'SDL.gpu.texture.create.d3d12.clear.r';
1867 _const_and_export SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT => 'SDL.gpu.texture.create.d3d12.clear.g';
1868 _const_and_export SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT => 'SDL.gpu.texture.create.d3d12.clear.b';
1869 _const_and_export SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT => 'SDL.gpu.texture.create.d3d12.clear.a';
1870 _const_and_export SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT => 'SDL.gpu.texture.create.d3d12.clear.depth';
1871 _const_and_export SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER => 'SDL.gpu.texture.create.d3d12.clear.stencil';
1872 _const_and_export SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING => 'SDL.gpu.texture.create.name';
1873 _affix_and_export SDL_CreateGPUBuffer => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUBufferCreateInfo() ] ], Pointer [ SDL_GPUBuffer() ];
1874 _const_and_export SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING => 'SDL.gpu.buffer.create.name';
1875 _affix_and_export
1876 SDL_CreateGPUTransferBuffer => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUTransferBufferCreateInfo() ] ],
1877 Pointer [ SDL_GPUTransferBuffer() ];
1878 _const_and_export SDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING => 'SDL.gpu.transferbuffer.create.name';
1879 _affix_and_export SDL_SetGPUBufferName => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUBuffer() ], String ], Void;
1880 _affix_and_export SDL_SetGPUTextureName => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUTexture() ], String ], Void;
1881 _affix_and_export SDL_InsertGPUDebugLabel => [ Pointer [ SDL_GPUCommandBuffer() ], String ], Void;
1882 _affix_and_export SDL_PushGPUDebugGroup => [ Pointer [ SDL_GPUCommandBuffer() ], String ], Void;
1883 _affix_and_export SDL_PopGPUDebugGroup => [ Pointer [ SDL_GPUCommandBuffer() ] ], Void;
1884 _affix_and_export SDL_ReleaseGPUTexture => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUTexture() ] ], Void;
1885 _affix_and_export SDL_ReleaseGPUSampler => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUSampler() ] ], Void;
1886 _affix_and_export SDL_ReleaseGPUBuffer => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUBuffer() ] ], Void;
1887 _affix_and_export
1888 SDL_ReleaseGPUTransferBuffer => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUTransferBuffer() ] ],
1889 Void;
1890 _affix_and_export
1891 SDL_ReleaseGPUComputePipeline => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUComputePipeline() ] ],
1892 Void;
1893 _affix_and_export SDL_ReleaseGPUShader => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUShader() ] ], Void;
1894 _affix_and_export
1895 SDL_ReleaseGPUGraphicsPipeline => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUGraphicsPipeline() ] ],
1896 Void;
1897 _affix_and_export SDL_AcquireGPUCommandBuffer => [ Pointer [ SDL_GPUDevice() ] ], Pointer [ SDL_GPUCommandBuffer() ];
1898 _affix_and_export
1899 SDL_PushGPUVertexUniformData => [ Pointer [ SDL_GPUCommandBuffer() ], UInt32, Pointer [Void], UInt32 ],
1900 Void;
1901 _affix_and_export
1902 SDL_PushGPUFragmentUniformData => [ Pointer [ SDL_GPUCommandBuffer() ], UInt32, Pointer [Void], UInt32 ],
1903 Void;
1904 _affix_and_export
1905 SDL_PushGPUComputeUniformData => [ Pointer [ SDL_GPUCommandBuffer() ], UInt32, Pointer [Void], UInt32 ],
1906 Void;
1907 _affix_and_export
1908 SDL_BeginGPURenderPass =>
1909 [ Pointer [ SDL_GPUCommandBuffer() ], Pointer [ SDL_GPUColorTargetInfo() ], UInt32, Pointer [ SDL_GPUDepthStencilTargetInfo() ] ],
1910 Pointer [ SDL_GPURenderPass() ];
1911 _affix_and_export
1912 SDL_BindGPUGraphicsPipeline => [ Pointer [ SDL_GPURenderPass() ], Pointer [ SDL_GPUGraphicsPipeline() ] ],
1913 Void;
1914 _affix_and_export SDL_SetGPUViewport => [ Pointer [ SDL_GPURenderPass() ], Pointer [ SDL_GPUViewport() ] ], Void;
1915 _affix_and_export SDL_SetGPUScissor => [ Pointer [ SDL_GPURenderPass() ], Pointer [ SDL_Rect() ] ], Void;
1916 _affix_and_export SDL_SetGPUBlendConstants => [ Pointer [ SDL_GPURenderPass() ], SDL_FColor() ], Void;
1917 _affix_and_export SDL_SetGPUStencilReference => [ Pointer [ SDL_GPURenderPass() ], UInt8 ], Void;
1918 _affix_and_export
1919 SDL_BindGPUVertexBuffers => [ Pointer [ SDL_GPURenderPass() ], UInt32, Pointer [ SDL_GPUBufferBinding() ], UInt32 ],
1920 Void;
1921 _affix_and_export
1922 SDL_BindGPUIndexBuffer => [ Pointer [ SDL_GPURenderPass() ], Pointer [ SDL_GPUBufferBinding() ], SDL_GPUIndexElementSize() ],
1923 Void;
1924 _affix_and_export
1925 SDL_BindGPUVertexSamplers => [ Pointer [ SDL_GPURenderPass() ], UInt32, Pointer [ SDL_GPUTextureSamplerBinding() ], UInt32 ],
1926 Void;
1927 _affix_and_export
1928 SDL_BindGPUVertexStorageTextures => [ Pointer [ SDL_GPURenderPass() ], UInt32, Pointer [ Pointer [ SDL_GPUTexture() ] ], UInt32 ],
1929 Void;
1930 _affix_and_export
1931 SDL_BindGPUVertexStorageBuffers => [ Pointer [ SDL_GPURenderPass() ], UInt32, Pointer [ Pointer [ SDL_GPUBuffer() ] ], UInt32 ],
1932 Void;
1933 _affix_and_export
1934 SDL_BindGPUFragmentSamplers => [ Pointer [ SDL_GPURenderPass() ], UInt32, Pointer [ SDL_GPUTextureSamplerBinding() ], UInt32 ],
1935 Void;
1936 _affix_and_export
1937 SDL_BindGPUFragmentStorageTextures => [ Pointer [ SDL_GPURenderPass() ], UInt32, Pointer [ Pointer [ SDL_GPUTexture() ] ], UInt32 ],
1938 Void;
1939 _affix_and_export
1940 SDL_BindGPUFragmentStorageBuffers => [ Pointer [ SDL_GPURenderPass() ], UInt32, Pointer [ Pointer [ SDL_GPUBuffer() ] ], UInt32 ],
1941 Void;
1942 _affix_and_export
1943 SDL_DrawGPUIndexedPrimitives => [ Pointer [ SDL_GPURenderPass() ], UInt32, UInt32, UInt32, SInt32, UInt32 ],
1944 Void;
1945 _affix_and_export
1946 SDL_DrawGPUPrimitives => [ Pointer [ SDL_GPURenderPass() ], UInt32, UInt32, UInt32, UInt32 ],
1947 Void;
1948 _affix_and_export
1949 SDL_DrawGPUPrimitivesIndirect => [ Pointer [ SDL_GPURenderPass() ], Pointer [ SDL_GPUBuffer() ], UInt32, UInt32 ],
1950 Void;
1951 _affix_and_export
1952 SDL_DrawGPUIndexedPrimitivesIndirect => [ Pointer [ SDL_GPURenderPass() ], Pointer [ SDL_GPUBuffer() ], UInt32, UInt32 ],
1953 Void;
1954 _affix_and_export SDL_EndGPURenderPass => [ Pointer [ SDL_GPURenderPass() ] ], Void;
1955 _affix_and_export
1956 SDL_BeginGPUComputePass => [
1957 Pointer [ SDL_GPUCommandBuffer() ],
1958 Pointer [ SDL_GPUStorageTextureReadWriteBinding() ],
1959 UInt32, Pointer [ SDL_GPUStorageBufferReadWriteBinding() ], UInt32
1960 ],
1961 Pointer [ SDL_GPUComputePass() ];
1962 _affix_and_export
1963 SDL_BindGPUComputePipeline => [ Pointer [ SDL_GPUComputePass() ], Pointer [ SDL_GPUComputePipeline() ] ],
1964 Void;
1965 _affix_and_export
1966 SDL_BindGPUComputeSamplers => [ Pointer [ SDL_GPUComputePass() ], UInt32, Pointer [ SDL_GPUTextureSamplerBinding() ], UInt32 ],
1967 Void;
1968 _affix_and_export
1969 SDL_BindGPUComputeStorageTextures => [ Pointer [ SDL_GPUComputePass() ], UInt32, Pointer [ Pointer [ SDL_GPUTexture() ] ], UInt32 ],
1970 Void;
1971 _affix_and_export
1972 SDL_BindGPUComputeStorageBuffers => [ Pointer [ SDL_GPUComputePass() ], UInt32, Pointer [ Pointer [ SDL_GPUBuffer() ] ], UInt32 ],
1973 Void;
1974 _affix_and_export SDL_DispatchGPUCompute => [ Pointer [ SDL_GPUComputePass() ], UInt32, UInt32, UInt32 ], Void;
1975 _affix_and_export
1976 SDL_DispatchGPUComputeIndirect => [ Pointer [ SDL_GPUComputePass() ], Pointer [ SDL_GPUBuffer() ], UInt32 ],
1977 Void;
1978 _affix_and_export SDL_EndGPUComputePass => [ Pointer [ SDL_GPUComputePass() ] ], Void;
1979 _affix_and_export
1980 SDL_MapGPUTransferBuffer => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUTransferBuffer() ], Bool ],
1981 Pointer [Void];
1982 _affix_and_export SDL_UnmapGPUTransferBuffer => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUTransferBuffer() ] ], Void;
1983 _affix_and_export SDL_BeginGPUCopyPass => [ Pointer [ SDL_GPUCommandBuffer() ] ], Pointer [ SDL_GPUCopyPass() ];
1984 _affix_and_export
1985 SDL_UploadToGPUTexture =>
1986 [ Pointer [ SDL_GPUCopyPass() ], Pointer [ SDL_GPUTextureTransferInfo() ], Pointer [ SDL_GPUTextureRegion() ], Bool ],
1987 Void;
1988 _affix_and_export
1989 SDL_UploadToGPUBuffer =>
1990 [ Pointer [ SDL_GPUCopyPass() ], Pointer [ SDL_GPUTransferBufferLocation() ], Pointer [ SDL_GPUBufferRegion() ], Bool ],
1991 Void;
1992 _affix_and_export
1993 SDL_CopyGPUTextureToTexture => [
1994 Pointer [ SDL_GPUCopyPass() ],
1995 Pointer [ SDL_GPUTextureLocation() ],
1996 Pointer [ SDL_GPUTextureLocation() ],
1997 UInt32, UInt32, UInt32, Bool
1998 ],
1999 Void;
2000 _affix_and_export
2001 SDL_CopyGPUBufferToBuffer =>
2002 [ Pointer [ SDL_GPUCopyPass() ], Pointer [ SDL_GPUBufferLocation() ], Pointer [ SDL_GPUBufferLocation() ], UInt32, Bool ],
2003 Void;
2004 _affix_and_export
2005 SDL_DownloadFromGPUTexture =>
2006 [ Pointer [ SDL_GPUCopyPass() ], Pointer [ SDL_GPUTextureRegion() ], Pointer [ SDL_GPUTextureTransferInfo() ] ],
2007 Void;
2008 _affix_and_export
2009 SDL_DownloadFromGPUBuffer =>
2010 [ Pointer [ SDL_GPUCopyPass() ], Pointer [ SDL_GPUBufferRegion() ], Pointer [ SDL_GPUTransferBufferLocation() ] ],
2011 Void;
2012 _affix_and_export SDL_EndGPUCopyPass => [ Pointer [ SDL_GPUCopyPass() ] ], Void;
2013 _affix_and_export
2014 SDL_GenerateMipmapsForGPUTexture => [ Pointer [ SDL_GPUCommandBuffer() ], Pointer [ SDL_GPUTexture() ] ],
2015 Void;
2016 _affix_and_export SDL_BlitGPUTexture => [ Pointer [ SDL_GPUCommandBuffer() ], Pointer [ SDL_GPUBlitInfo() ] ], Void;
2017 _affix_and_export
2018 SDL_WindowSupportsGPUSwapchainComposition => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ], SDL_GPUSwapchainComposition() ],
2019 Bool;
2020 _affix_and_export
2021 SDL_WindowSupportsGPUPresentMode => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ], SDL_GPUPresentMode() ],
2022 Bool;
2023 _affix_and_export SDL_ClaimWindowForGPUDevice => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ] ], Bool;
2024 _affix_and_export SDL_ReleaseWindowFromGPUDevice => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ] ], Void;
2025 _affix_and_export
2026 SDL_SetGPUSwapchainParameters =>
2027 [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ], SDL_GPUSwapchainComposition(), SDL_GPUPresentMode() ],
2028 Bool;
2029 _affix_and_export SDL_SetGPUAllowedFramesInFlight => [ Pointer [ SDL_GPUDevice() ], UInt32 ], Bool;
2030 _affix_and_export
2031 SDL_GetGPUSwapchainTextureFormat => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ] ],
2032 SDL_GPUTextureFormat();
2033 _affix_and_export
2034 SDL_AcquireGPUSwapchainTexture => [
2035 Pointer [ SDL_GPUCommandBuffer() ],
2036 Pointer [ SDL_Window() ],
2037 Pointer [ Pointer [ SDL_GPUTexture() ] ],
2038 Pointer [UInt32],
2039 Pointer [UInt32]
2040 ],
2041 Bool;
2042 _affix_and_export SDL_WaitForGPUSwapchain => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ] ], Bool;
2043 _affix_and_export
2044 SDL_WaitAndAcquireGPUSwapchainTexture => [
2045 Pointer [ SDL_GPUCommandBuffer() ],
2046 Pointer [ SDL_Window() ],
2047 Pointer [ Pointer [ SDL_GPUTexture() ] ],
2048 Pointer [UInt32],
2049 Pointer [UInt32]
2050 ],
2051 Bool;
2052 _affix_and_export SDL_SubmitGPUCommandBuffer => [ Pointer [ SDL_GPUCommandBuffer() ] ], Bool;
2053 _affix_and_export SDL_SubmitGPUCommandBufferAndAcquireFence => [ Pointer [ SDL_GPUCommandBuffer() ] ], Pointer [ SDL_GPUFence() ];
2054 _affix_and_export SDL_CancelGPUCommandBuffer => [ Pointer [ SDL_GPUCommandBuffer() ] ], Bool;
2055 _affix_and_export SDL_WaitForGPUIdle => [ Pointer [ SDL_GPUDevice() ] ], Bool;
2056 _affix_and_export
2057 SDL_WaitForGPUFences => [ Pointer [ SDL_GPUDevice() ], Bool, Pointer [ Pointer [ SDL_GPUFence() ] ], UInt32 ],
2058 Bool;
2059 _affix_and_export SDL_QueryGPUFence => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUFence() ] ], Bool;
2060 _affix_and_export SDL_ReleaseGPUFence => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_GPUFence() ] ], Void;
2061 _affix_and_export SDL_GPUTextureFormatTexelBlockSize => [ SDL_GPUTextureFormat() ], UInt32;
2062 _affix_and_export
2063 SDL_GPUTextureSupportsFormat => [ Pointer [ SDL_GPUDevice() ], SDL_GPUTextureFormat(), SDL_GPUTextureType(), SDL_GPUTextureUsageFlags() ],
2064 Bool;
2065 _affix_and_export
2066 SDL_GPUTextureSupportsSampleCount => [ Pointer [ SDL_GPUDevice() ], SDL_GPUTextureFormat(), SDL_GPUSampleCount() ],
2067 Bool;
2068 _affix_and_export
2069 SDL_CalculateGPUTextureFormatSize => [ SDL_GPUTextureFormat(), UInt32, UInt32, UInt32 ],
2070 UInt32;
2071
2072 #~ _affix_and_export SDL_GetPixelFormatFromGPUTextureFormat => [ SDL_GPUTextureFormat() ], SDL_PixelFormat();
2073 #~ _affix_and_export SDL_GetGPUTextureFormatFromPixelFormat => [ SDL_PixelFormat() ], SDL_GPUTextureFormat();
2074 }
2075
2076 =head3 C<:guid> - GUIDs
2077
2078 A GUID is a 128-bit value that represents something that is uniquely identifiable by this value: "globally unique."
2079
2080 SDL provides functions to convert a GUID to/from a string.
2081
2082 See L<SDL3: CategoryGUID|https://wiki.libsdl.org/SDL3/CategoryGUID>
2083
2084 =cut
2085
2086 sub _guid() {
2087 state $done++ && return;
2088 #
2089 _stdinc();
2090 #
2091 _typedef_and_export SDL_GUID => Struct [ data => Array [ UInt8, 16 ] ];
2092 #
2093 _affix_and_export SDL_GUIDToString => [ SDL_GUID(), String, Int ], Void;
2094 _affix_and_export SDL_StringToGUID => [String], SDL_GUID();
2095 }
2096
2097 =head3 C<:haptic> - Force Feedback Support
2098
2099 The SDL haptic subsystem manages haptic (force feedback) devices.
2100
2101 See L<SDL3: CategoryHaptic|https://wiki.libsdl.org/SDL3/CategoryHaptic>
2102
2103 =cut
2104
2105 sub _haptic() {
2106 state $done++ && return;
2107 #
2108 _error();
2109 _joystick();
2110 _stdinc();
2111 #
2112 _typedef_and_export SDL_Haptic => Void;
2113 _typedef_and_export SDL_HapticID => UInt32;
2114 _const_and_export SDL_HAPTIC_INFINITY => 4294967295;
2115 _typedef_and_export SDL_HapticEffectType => UInt16;
2116 _const_and_export SDL_HAPTIC_CONSTANT => ( 1 << 0 );
2117 _const_and_export SDL_HAPTIC_SINE => ( 1 << 1 );
2118 _const_and_export SDL_HAPTIC_SQUARE => ( 1 << 2 );
2119 _const_and_export SDL_HAPTIC_TRIANGLE => ( 1 << 3 );
2120 _const_and_export SDL_HAPTIC_SAWTOOTHUP => ( 1 << 4 );
2121 _const_and_export SDL_HAPTIC_SAWTOOTHDOWN => ( 1 << 5 );
2122 _const_and_export SDL_HAPTIC_RAMP => ( 1 << 6 );
2123 _const_and_export SDL_HAPTIC_SPRING => ( 1 << 7 );
2124 _const_and_export SDL_HAPTIC_DAMPER => ( 1 << 8 );
2125 _const_and_export SDL_HAPTIC_INERTIA => ( 1 << 9 );
2126 _const_and_export SDL_HAPTIC_FRICTION => ( 1 << 10 );
2127 _const_and_export SDL_HAPTIC_LEFTRIGHT => ( 1 << 11 );
2128 _const_and_export SDL_HAPTIC_RESERVED1 => ( 1 << 12 );
2129 _const_and_export SDL_HAPTIC_RESERVED2 => ( 1 << 13 );
2130 _const_and_export SDL_HAPTIC_RESERVED3 => ( 1 << 14 );
2131 _const_and_export SDL_HAPTIC_CUSTOM => ( 1 << 15 );
2132 _const_and_export SDL_HAPTIC_GAIN => ( 1 << 16 );
2133 _const_and_export SDL_HAPTIC_AUTOCENTER => ( 1 << 17 );
2134 _const_and_export SDL_HAPTIC_STATUS => ( 1 << 18 );
2135 _const_and_export SDL_HAPTIC_PAUSE => ( 1 << 19 );
2136 _typedef_and_export SDL_HapticDirectionType => UInt8;
2137 _const_and_export SDL_HAPTIC_POLAR => 0;
2138 _const_and_export SDL_HAPTIC_CARTESIAN => 1;
2139 _const_and_export SDL_HAPTIC_SPHERICAL => 2;
2140 _const_and_export SDL_HAPTIC_STEERING_AXIS => 3;
2141 _typedef_and_export SDL_HapticEffectID => Int;
2142 _typedef_and_export SDL_HapticDirection => Struct [ type => SDL_HapticDirectionType(), dir => Array [ SInt32, 3 ] ];
2143 _typedef_and_export SDL_HapticConstant => Struct [
2144 type => SDL_HapticEffectType(),
2145 direction => SDL_HapticDirection(),
2146 length => UInt32,
2147 delay => UInt16,
2148 button => UInt16,
2149 interval => UInt16,
2150 level => SInt16,
2151 attack_length => UInt16,
2152 attack_level => UInt16,
2153 fade_length => UInt16,
2154 fade_level => UInt16
2155 ];
2156 _typedef_and_export SDL_HapticPeriodic => Struct [
2157 type => SDL_HapticEffectType(),
2158 direction => SDL_HapticDirection(),
2159 length => UInt32,
2160 delay => UInt16,
2161 button => UInt16,
2162 interval => UInt16,
2163 period => UInt16,
2164 magnitude => SInt16,
2165 offset => SInt16,
2166 phase => UInt16,
2167 attack_length => UInt16,
2168 attack_level => UInt16,
2169 fade_length => UInt16,
2170 fade_level => UInt16
2171 ];
2172 _typedef_and_export SDL_HapticCondition => Struct [
2173 type => SDL_HapticEffectType(),
2174 direction => SDL_HapticDirection(),
2175 length => UInt32,
2176 delay => UInt16,
2177 button => UInt16,
2178 interval => UInt16,
2179 right_sat => Array [ UInt16, 3 ],
2180 left_sat => Array [ UInt16, 3 ],
2181 right_coeff => Array [ SInt16, 3 ],
2182 left_coeff => Array [ SInt16, 3 ],
2183 deadband => Array [ UInt16, 3 ],
2184 center => Array [ SInt16, 3 ]
2185 ];
2186 _typedef_and_export SDL_HapticRamp => Struct [
2187 type => SDL_HapticEffectType(),
2188 direction => SDL_HapticDirection(),
2189 length => UInt32,
2190 delay => UInt16,
2191 button => UInt16,
2192 interval => UInt16,
2193 start => SInt16,
2194 end => SInt16,
2195 attack_length => UInt16,
2196 attack_level => UInt16,
2197 fade_length => UInt16,
2198 fade_level => UInt16
2199 ];
2200 _typedef_and_export SDL_HapticLeftRight =>
2201 Struct [ type => SDL_HapticEffectType(), length => UInt32, large_magnitude => UInt16, small_magnitude => UInt16 ];
2202 _typedef_and_export SDL_HapticCustom => Struct [
2203 type => SDL_HapticEffectType(),
2204 direction => SDL_HapticDirection(),
2205 length => UInt32,
2206 delay => UInt16,
2207 button => UInt16,
2208 interval => UInt16,
2209 channels => UInt8,
2210 period => UInt16,
2211 samples => UInt16,
2212 data => Pointer [UInt16],
2213 attack_length => UInt16,
2214 attack_level => UInt16,
2215 fade_length => UInt16,
2216 fade_level => UInt16
2217 ];
2218 _typedef_and_export SDL_HapticEffect => Union [
2219 type => SDL_HapticEffectType(),
2220 constant => SDL_HapticConstant(),
2221 periodic => SDL_HapticPeriodic(),
2222 condition => SDL_HapticCondition(),
2223 ramp => SDL_HapticRamp(),
2224 leftright => SDL_HapticLeftRight(),
2225 custom => SDL_HapticCustom()
2226 ];
2227 _affix_and_export SDL_GetHaptics => [ Pointer [Int] ], Pointer [ SDL_HapticID() ];
2228 _affix_and_export SDL_GetHapticNameForID => [ SDL_HapticID() ], String;
2229 _affix_and_export SDL_OpenHaptic => [ SDL_HapticID() ], Pointer [ SDL_Haptic() ];
2230 _affix_and_export SDL_GetHapticFromID => [ SDL_HapticID() ], Pointer [ SDL_Haptic() ];
2231 _affix_and_export SDL_GetHapticID => [ Pointer [ SDL_Haptic() ] ], SDL_HapticID();
2232 _affix_and_export SDL_GetHapticName => [ Pointer [ SDL_Haptic() ] ], String;
2233 _affix_and_export SDL_IsMouseHaptic => [], Bool;
2234 _affix_and_export SDL_OpenHapticFromMouse => [], Pointer [ SDL_Haptic() ];
2235 _affix_and_export SDL_IsJoystickHaptic => [ Pointer [ SDL_Joystick() ] ], Bool;
2236 _affix_and_export SDL_OpenHapticFromJoystick => [ Pointer [ SDL_Joystick() ] ], Pointer [ SDL_Haptic() ];
2237 _affix_and_export SDL_CloseHaptic => [ Pointer [ SDL_Haptic() ] ], Void;
2238 _affix_and_export SDL_GetMaxHapticEffects => [ Pointer [ SDL_Haptic() ] ], Int;
2239 _affix_and_export SDL_GetMaxHapticEffectsPlaying => [ Pointer [ SDL_Haptic() ] ], Int;
2240 _affix_and_export SDL_GetHapticFeatures => [ Pointer [ SDL_Haptic() ] ], UInt32;
2241 _affix_and_export SDL_GetNumHapticAxes => [ Pointer [ SDL_Haptic() ] ], Int;
2242 _affix_and_export SDL_HapticEffectSupported => [ Pointer [ SDL_Haptic() ], Pointer [ SDL_HapticEffect() ] ], Bool;
2243 _affix_and_export SDL_CreateHapticEffect => [ Pointer [ SDL_Haptic() ], Pointer [ SDL_HapticEffect() ] ], SDL_HapticEffectID();
2244 _affix_and_export
2245 SDL_UpdateHapticEffect => [ Pointer [ SDL_Haptic() ], SDL_HapticEffectID(), Pointer [ SDL_HapticEffect() ] ],
2246 Bool;
2247 _affix_and_export SDL_RunHapticEffect => [ Pointer [ SDL_Haptic() ], SDL_HapticEffectID(), UInt32 ], Bool;
2248 _affix_and_export SDL_StopHapticEffect => [ Pointer [ SDL_Haptic() ], SDL_HapticEffectID() ], Bool;
2249 _affix_and_export SDL_DestroyHapticEffect => [ Pointer [ SDL_Haptic() ], SDL_HapticEffectID() ], Void;
2250 _affix_and_export SDL_GetHapticEffectStatus => [ Pointer [ SDL_Haptic() ], SDL_HapticEffectID() ], Bool;
2251 _affix_and_export SDL_SetHapticGain => [ Pointer [ SDL_Haptic() ], Int ], Bool;
2252 _affix_and_export SDL_SetHapticAutocenter => [ Pointer [ SDL_Haptic() ], Int ], Bool;
2253 _affix_and_export SDL_PauseHaptic => [ Pointer [ SDL_Haptic() ] ], Bool;
2254 _affix_and_export SDL_ResumeHaptic => [ Pointer [ SDL_Haptic() ] ], Bool;
2255 _affix_and_export SDL_StopHapticEffects => [ Pointer [ SDL_Haptic() ] ], Bool;
2256 _affix_and_export SDL_HapticRumbleSupported => [ Pointer [ SDL_Haptic() ] ], Bool;
2257 _affix_and_export SDL_InitHapticRumble => [ Pointer [ SDL_Haptic() ] ], Bool;
2258 _affix_and_export SDL_PlayHapticRumble => [ Pointer [ SDL_Haptic() ], Float, UInt32 ], Bool;
2259 _affix_and_export SDL_StopHapticRumble => [ Pointer [ SDL_Haptic() ] ], Bool;
2260 }
2261
2262 =head3 C<:hidapi> - HIDAPI
2263
2264 HID devices.
2265
2266 See L<SDL3: CategoryHIDAPI|https://wiki.libsdl.org/SDL3/CategoryHIDAPI>
2267
2268 =cut
2269
2270 sub _hidapi() {
2271 state $done++ && return;
2272 #
2273 _error();
2274 _properties();
2275 _stdinc();
2276 #
2277 _typedef_and_export SDL_hid_device => Void;
2278 _enum_and_export SDL_hid_bus_type => [
2279 [ SDL_HID_API_BUS_UNKNOWN => 0x00 ],
2280 [ SDL_HID_API_BUS_USB => 0x01 ],
2281 [ SDL_HID_API_BUS_BLUETOOTH => 0x02 ],
2282 [ SDL_HID_API_BUS_I2C => 0x03 ],
2283 [ SDL_HID_API_BUS_SPI => 0x04 ]
2284 ];
2285 typedef 'SDL_hid_device_info';
2286 _typedef_and_export SDL_hid_device_info => Struct [
2287 path => String,
2288 vendor_id => UShort,
2289 product_id => UShort,
2290 serial_number => WString,
2291 release_number => UShort,
2292 manufacturer_string => WString,
2293 product_string => WString,
2294 usage_page => UShort,
2295 usage => UShort,
2296 interface_number => Int,
2297 interface_class => Int,
2298 interface_subclass => Int,
2299 interface_protocol => Int,
2300 bus_type => SDL_hid_bus_type(),
2301 next => Pointer [ SDL_hid_device_info() ]
2302 ];
2303 _affix_and_export SDL_hid_init => [], Int;
2304 _affix_and_export SDL_hid_exit => [], Int;
2305 _affix_and_export SDL_hid_device_change_count => [], UInt32;
2306 _affix_and_export SDL_hid_enumerate => [ UShort, UShort ], Pointer [ SDL_hid_device_info() ];
2307 _affix_and_export SDL_hid_free_enumeration => [ Pointer [ SDL_hid_device_info() ] ], Void;
2308 _affix_and_export SDL_hid_open => [ UShort, UShort, WString ], Pointer [ SDL_hid_device() ];
2309 _affix_and_export SDL_hid_open_path => [String], Pointer [ SDL_hid_device() ];
2310
2311 #~ _affix_and_export SDL_hid_get_properties => [ Pointer [ SDL_hid_device() ] ], SDL_PropertiesID();
2312 _const_and_export SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER => 'SDL.hidapi.libusb.device.handle';
2313 _affix_and_export SDL_hid_write => [ Pointer [ SDL_hid_device() ], Pointer [UChar], Size_t ], Int;
2314 _affix_and_export SDL_hid_read_timeout => [ Pointer [ SDL_hid_device() ], Pointer [UChar], Size_t, Int ], Int;
2315 _affix_and_export SDL_hid_read => [ Pointer [ SDL_hid_device() ], Pointer [UChar], Size_t ], Int;
2316 _affix_and_export SDL_hid_set_nonblocking => [ Pointer [ SDL_hid_device() ], Int ], Int;
2317 _affix_and_export SDL_hid_send_feature_report => [ Pointer [ SDL_hid_device() ], Pointer [UChar], Size_t ], Int;
2318 _affix_and_export SDL_hid_get_feature_report => [ Pointer [ SDL_hid_device() ], Pointer [UChar], Size_t ], Int;
2319 _affix_and_export SDL_hid_get_input_report => [ Pointer [ SDL_hid_device() ], Pointer [UChar], Size_t ], Int;
2320 _affix_and_export SDL_hid_close => [ Pointer [ SDL_hid_device() ] ], Int;
2321 _affix_and_export SDL_hid_get_manufacturer_string => [ Pointer [ SDL_hid_device() ], WString, Size_t ], Int;
2322 _affix_and_export SDL_hid_get_product_string => [ Pointer [ SDL_hid_device() ], WString, Size_t ], Int;
2323 _affix_and_export SDL_hid_get_serial_number_string => [ Pointer [ SDL_hid_device() ], WString, Size_t ], Int;
2324 _affix_and_export SDL_hid_get_indexed_string => [ Pointer [ SDL_hid_device() ], Int, WString, Size_t ], Int;
2325 _affix_and_export SDL_hid_get_device_info => [ Pointer [ SDL_hid_device() ] ], Pointer [ SDL_hid_device_info() ];
2326 _affix_and_export SDL_hid_get_report_descriptor => [ Pointer [ SDL_hid_device() ], Pointer [UChar], Size_t ], Int;
2327 _affix_and_export SDL_hid_ble_scan => [Bool], Void;
2328 }
2329
2330 =head3 C<:hints> - Configuration Variables
2331
2332 Functions to set and get configuration hints, as well as listing each of them alphabetically.
2333
2334 See L<SDL3: CategoryHints|https://wiki.libsdl.org/SDL3/CategoryHints>
2335
2336 =cut
2337
2338 sub _hints() {
2339 state $done++ && return;
2340 #
2341 _error();
2342 _stdinc();
2343 #
2344 _const_and_export SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => 'SDL_ALLOW_ALT_TAB_WHILE_GRABBED';
2345 _const_and_export SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY => 'SDL_ANDROID_ALLOW_RECREATE_ACTIVITY';
2346 _const_and_export SDL_HINT_ANDROID_BLOCK_ON_PAUSE => 'SDL_ANDROID_BLOCK_ON_PAUSE';
2347 _const_and_export SDL_HINT_ANDROID_LOW_LATENCY_AUDIO => 'SDL_ANDROID_LOW_LATENCY_AUDIO';
2348 _const_and_export SDL_HINT_ANDROID_TRAP_BACK_BUTTON => 'SDL_ANDROID_TRAP_BACK_BUTTON';
2349 _const_and_export SDL_HINT_APP_ID => 'SDL_APP_ID';
2350 _const_and_export SDL_HINT_APP_NAME => 'SDL_APP_NAME';
2351 _const_and_export SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS => 'SDL_APPLE_TV_CONTROLLER_UI_EVENTS';
2352 _const_and_export SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION => 'SDL_APPLE_TV_REMOTE_ALLOW_ROTATION';
2353 _const_and_export SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE => 'SDL_AUDIO_ALSA_DEFAULT_DEVICE';
2354 _const_and_export SDL_HINT_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE => 'SDL_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE';
2355 _const_and_export SDL_HINT_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE => 'SDL_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE';
2356 _const_and_export SDL_HINT_AUDIO_CATEGORY => 'SDL_AUDIO_CATEGORY';
2357 _const_and_export SDL_HINT_AUDIO_CHANNELS => 'SDL_AUDIO_CHANNELS';
2358 _const_and_export SDL_HINT_AUDIO_DEVICE_APP_ICON_NAME => 'SDL_AUDIO_DEVICE_APP_ICON_NAME';
2359 _const_and_export SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES => 'SDL_AUDIO_DEVICE_SAMPLE_FRAMES';
2360 _const_and_export SDL_HINT_AUDIO_DEVICE_STREAM_NAME => 'SDL_AUDIO_DEVICE_STREAM_NAME';
2361 _const_and_export SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => 'SDL_AUDIO_DEVICE_STREAM_ROLE';
2362 _const_and_export SDL_HINT_AUDIO_DEVICE_RAW_STREAM => 'SDL_AUDIO_DEVICE_RAW_STREAM';
2363 _const_and_export SDL_HINT_AUDIO_DISK_INPUT_FILE => 'SDL_AUDIO_DISK_INPUT_FILE';
2364 _const_and_export SDL_HINT_AUDIO_DISK_OUTPUT_FILE => 'SDL_AUDIO_DISK_OUTPUT_FILE';
2365 _const_and_export SDL_HINT_AUDIO_DISK_TIMESCALE => 'SDL_AUDIO_DISK_TIMESCALE';
2366 _const_and_export SDL_HINT_AUDIO_DRIVER => 'SDL_AUDIO_DRIVER';
2367 _const_and_export SDL_HINT_AUDIO_DUMMY_TIMESCALE => 'SDL_AUDIO_DUMMY_TIMESCALE';
2368 _const_and_export SDL_HINT_AUDIO_FORMAT => 'SDL_AUDIO_FORMAT';
2369 _const_and_export SDL_HINT_AUDIO_FREQUENCY => 'SDL_AUDIO_FREQUENCY';
2370 _const_and_export SDL_HINT_AUDIO_INCLUDE_MONITORS => 'SDL_AUDIO_INCLUDE_MONITORS';
2371 _const_and_export SDL_HINT_AUTO_UPDATE_JOYSTICKS => 'SDL_AUTO_UPDATE_JOYSTICKS';
2372 _const_and_export SDL_HINT_AUTO_UPDATE_SENSORS => 'SDL_AUTO_UPDATE_SENSORS';
2373 _const_and_export SDL_HINT_BMP_SAVE_LEGACY_FORMAT => 'SDL_BMP_SAVE_LEGACY_FORMAT';
2374 _const_and_export SDL_HINT_CAMERA_DRIVER => 'SDL_CAMERA_DRIVER';
2375 _const_and_export SDL_HINT_CPU_FEATURE_MASK => 'SDL_CPU_FEATURE_MASK';
2376 _const_and_export SDL_HINT_JOYSTICK_DIRECTINPUT => 'SDL_JOYSTICK_DIRECTINPUT';
2377 _const_and_export SDL_HINT_FILE_DIALOG_DRIVER => 'SDL_FILE_DIALOG_DRIVER';
2378 _const_and_export SDL_HINT_DISPLAY_USABLE_BOUNDS => 'SDL_DISPLAY_USABLE_BOUNDS';
2379 _const_and_export SDL_HINT_INVALID_PARAM_CHECKS => 'SDL_INVALID_PARAM_CHECKS';
2380 _const_and_export SDL_HINT_EMSCRIPTEN_ASYNCIFY => 'SDL_EMSCRIPTEN_ASYNCIFY';
2381 _const_and_export SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR => 'SDL_EMSCRIPTEN_CANVAS_SELECTOR';
2382 _const_and_export SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => 'SDL_EMSCRIPTEN_KEYBOARD_ELEMENT';
2383 _const_and_export SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT => 'SDL_EMSCRIPTEN_FILL_DOCUMENT';
2384 _const_and_export SDL_HINT_ENABLE_SCREEN_KEYBOARD => 'SDL_ENABLE_SCREEN_KEYBOARD';
2385 _const_and_export SDL_HINT_EVDEV_DEVICES => 'SDL_EVDEV_DEVICES';
2386 _const_and_export SDL_HINT_EVENT_LOGGING => 'SDL_EVENT_LOGGING';
2387 _const_and_export SDL_HINT_FORCE_RAISEWINDOW => 'SDL_FORCE_RAISEWINDOW';
2388 _const_and_export SDL_HINT_FRAMEBUFFER_ACCELERATION => 'SDL_FRAMEBUFFER_ACCELERATION';
2389 _const_and_export SDL_HINT_GAMECONTROLLERCONFIG => 'SDL_GAMECONTROLLERCONFIG';
2390 _const_and_export SDL_HINT_GAMECONTROLLERCONFIG_FILE => 'SDL_GAMECONTROLLERCONFIG_FILE';
2391 _const_and_export SDL_HINT_GAMECONTROLLERTYPE => 'SDL_GAMECONTROLLERTYPE';
2392 _const_and_export SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES => 'SDL_GAMECONTROLLER_IGNORE_DEVICES';
2393 _const_and_export SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT => 'SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT';
2394 _const_and_export SDL_HINT_GAMECONTROLLER_SENSOR_FUSION => 'SDL_GAMECONTROLLER_SENSOR_FUSION';
2395 _const_and_export SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT => 'SDL_GDK_TEXTINPUT_DEFAULT_TEXT';
2396 _const_and_export SDL_HINT_GDK_TEXTINPUT_DESCRIPTION => 'SDL_GDK_TEXTINPUT_DESCRIPTION';
2397 _const_and_export SDL_HINT_GDK_TEXTINPUT_MAX_LENGTH => 'SDL_GDK_TEXTINPUT_MAX_LENGTH';
2398 _const_and_export SDL_HINT_GDK_TEXTINPUT_SCOPE => 'SDL_GDK_TEXTINPUT_SCOPE';
2399 _const_and_export SDL_HINT_GDK_TEXTINPUT_TITLE => 'SDL_GDK_TEXTINPUT_TITLE';
2400 _const_and_export SDL_HINT_HIDAPI_LIBUSB => 'SDL_HIDAPI_LIBUSB';
2401 _const_and_export SDL_HINT_HIDAPI_LIBUSB_WHITELIST => 'SDL_HIDAPI_LIBUSB_WHITELIST';
2402 _const_and_export SDL_HINT_HIDAPI_UDEV => 'SDL_HIDAPI_UDEV';
2403 _const_and_export SDL_HINT_GPU_DRIVER => 'SDL_GPU_DRIVER';
2404 _const_and_export SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS => 'SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS';
2405 _const_and_export SDL_HINT_HIDAPI_IGNORE_DEVICES => 'SDL_HIDAPI_IGNORE_DEVICES';
2406 _const_and_export SDL_HINT_IME_IMPLEMENTED_UI => 'SDL_IME_IMPLEMENTED_UI';
2407 _const_and_export SDL_HINT_IOS_HIDE_HOME_INDICATOR => 'SDL_IOS_HIDE_HOME_INDICATOR';
2408 _const_and_export SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS => 'SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS';
2409 _const_and_export SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES => 'SDL_JOYSTICK_ARCADESTICK_DEVICES';
2410 _const_and_export SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED => 'SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED';
2411 _const_and_export SDL_HINT_JOYSTICK_BLACKLIST_DEVICES => 'SDL_JOYSTICK_BLACKLIST_DEVICES';
2412 _const_and_export SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED => 'SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED';
2413 _const_and_export SDL_HINT_JOYSTICK_DEVICE => 'SDL_JOYSTICK_DEVICE';
2414 _const_and_export SDL_HINT_JOYSTICK_ENHANCED_REPORTS => 'SDL_JOYSTICK_ENHANCED_REPORTS';
2415 _const_and_export SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES => 'SDL_JOYSTICK_FLIGHTSTICK_DEVICES';
2416 _const_and_export SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED => 'SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED';
2417 _const_and_export SDL_HINT_JOYSTICK_GAMEINPUT => 'SDL_JOYSTICK_GAMEINPUT';
2418 _const_and_export SDL_HINT_JOYSTICK_GAMECUBE_DEVICES => 'SDL_JOYSTICK_GAMECUBE_DEVICES';
2419 _const_and_export SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED => 'SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED';
2420 _const_and_export SDL_HINT_JOYSTICK_HIDAPI => 'SDL_JOYSTICK_HIDAPI';
2421 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS => 'SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS';
2422 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE => 'SDL_JOYSTICK_HIDAPI_GAMECUBE';
2423 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE => 'SDL_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE';
2424 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS => 'SDL_JOYSTICK_HIDAPI_JOY_CONS';
2425 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED => 'SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED';
2426 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_LUNA => 'SDL_JOYSTICK_HIDAPI_LUNA';
2427 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC => 'SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC';
2428 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_PS3 => 'SDL_JOYSTICK_HIDAPI_PS3';
2429 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_PS3_SIXAXIS_DRIVER => 'SDL_JOYSTICK_HIDAPI_PS3_SIXAXIS_DRIVER';
2430 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_PS4 => 'SDL_JOYSTICK_HIDAPI_PS4';
2431 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL => 'SDL_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL';
2432 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_PS5 => 'SDL_JOYSTICK_HIDAPI_PS5';
2433 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => 'SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED';
2434 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_SHIELD => 'SDL_JOYSTICK_HIDAPI_SHIELD';
2435 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_STADIA => 'SDL_JOYSTICK_HIDAPI_STADIA';
2436 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_STEAM => 'SDL_JOYSTICK_HIDAPI_STEAM';
2437 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_STEAM_HOME_LED => 'SDL_JOYSTICK_HIDAPI_STEAM_HOME_LED';
2438 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK => 'SDL_JOYSTICK_HIDAPI_STEAMDECK';
2439 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI => 'SDL_JOYSTICK_HIDAPI_STEAM_HORI';
2440 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_LG4FF => 'SDL_JOYSTICK_HIDAPI_LG4FF';
2441 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_8BITDO => 'SDL_JOYSTICK_HIDAPI_8BITDO';
2442 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_SINPUT => 'SDL_JOYSTICK_HIDAPI_SINPUT';
2443 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_ZUIKI => 'SDL_JOYSTICK_HIDAPI_ZUIKI';
2444 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI => 'SDL_JOYSTICK_HIDAPI_FLYDIGI';
2445 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_SWITCH => 'SDL_JOYSTICK_HIDAPI_SWITCH';
2446 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED => 'SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED';
2447 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => 'SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED';
2448 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 => 'SDL_JOYSTICK_HIDAPI_SWITCH2';
2449 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => 'SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS';
2450 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_WII => 'SDL_JOYSTICK_HIDAPI_WII';
2451 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED => 'SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED';
2452 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_XBOX => 'SDL_JOYSTICK_HIDAPI_XBOX';
2453 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 => 'SDL_JOYSTICK_HIDAPI_XBOX_360';
2454 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED => 'SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED';
2455 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS => 'SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS';
2456 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE => 'SDL_JOYSTICK_HIDAPI_XBOX_ONE';
2457 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED => 'SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED';
2458 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_GIP => 'SDL_JOYSTICK_HIDAPI_GIP';
2459 _const_and_export SDL_HINT_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA => 'SDL_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA';
2460 _const_and_export SDL_HINT_JOYSTICK_IOKIT => 'SDL_JOYSTICK_IOKIT';
2461 _const_and_export SDL_HINT_JOYSTICK_LINUX_CLASSIC => 'SDL_JOYSTICK_LINUX_CLASSIC';
2462 _const_and_export SDL_HINT_JOYSTICK_LINUX_DEADZONES => 'SDL_JOYSTICK_LINUX_DEADZONES';
2463 _const_and_export SDL_HINT_JOYSTICK_LINUX_DIGITAL_HATS => 'SDL_JOYSTICK_LINUX_DIGITAL_HATS';
2464 _const_and_export SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES => 'SDL_JOYSTICK_LINUX_HAT_DEADZONES';
2465 _const_and_export SDL_HINT_JOYSTICK_MFI => 'SDL_JOYSTICK_MFI';
2466 _const_and_export SDL_HINT_JOYSTICK_RAWINPUT => 'SDL_JOYSTICK_RAWINPUT';
2467 _const_and_export SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT => 'SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT';
2468 _const_and_export SDL_HINT_JOYSTICK_ROG_CHAKRAM => 'SDL_JOYSTICK_ROG_CHAKRAM';
2469 _const_and_export SDL_HINT_JOYSTICK_THREAD => 'SDL_JOYSTICK_THREAD';
2470 _const_and_export SDL_HINT_JOYSTICK_THROTTLE_DEVICES => 'SDL_JOYSTICK_THROTTLE_DEVICES';
2471 _const_and_export SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED => 'SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED';
2472 _const_and_export SDL_HINT_JOYSTICK_WGI => 'SDL_JOYSTICK_WGI';
2473 _const_and_export SDL_HINT_JOYSTICK_WHEEL_DEVICES => 'SDL_JOYSTICK_WHEEL_DEVICES';
2474 _const_and_export SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED => 'SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED';
2475 _const_and_export SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES => 'SDL_JOYSTICK_ZERO_CENTERED_DEVICES';
2476 _const_and_export SDL_HINT_JOYSTICK_HAPTIC_AXES => 'SDL_JOYSTICK_HAPTIC_AXES';
2477 _const_and_export SDL_HINT_KEYCODE_OPTIONS => 'SDL_KEYCODE_OPTIONS';
2478 _const_and_export SDL_HINT_KMSDRM_DEVICE_INDEX => 'SDL_KMSDRM_DEVICE_INDEX';
2479 _const_and_export SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => 'SDL_KMSDRM_REQUIRE_DRM_MASTER';
2480 _const_and_export SDL_HINT_KMSDRM_ATOMIC => 'SDL_KMSDRM_ATOMIC';
2481 _const_and_export SDL_HINT_LOGGING => 'SDL_LOGGING';
2482 _const_and_export SDL_HINT_MAC_BACKGROUND_APP => 'SDL_MAC_BACKGROUND_APP';
2483 _const_and_export SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK => 'SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK';
2484 _const_and_export SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => 'SDL_MAC_OPENGL_ASYNC_DISPATCH';
2485 _const_and_export SDL_HINT_MAC_OPTION_AS_ALT => 'SDL_MAC_OPTION_AS_ALT';
2486 _const_and_export SDL_HINT_MAC_SCROLL_MOMENTUM => 'SDL_MAC_SCROLL_MOMENTUM';
2487 _const_and_export SDL_HINT_MAIN_CALLBACK_RATE => 'SDL_MAIN_CALLBACK_RATE';
2488 _const_and_export SDL_HINT_MOUSE_AUTO_CAPTURE => 'SDL_MOUSE_AUTO_CAPTURE';
2489 _const_and_export SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS => 'SDL_MOUSE_DOUBLE_CLICK_RADIUS';
2490 _const_and_export SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => 'SDL_MOUSE_DOUBLE_CLICK_TIME';
2491 _const_and_export SDL_HINT_MOUSE_DEFAULT_SYSTEM_CURSOR => 'SDL_MOUSE_DEFAULT_SYSTEM_CURSOR';
2492 _const_and_export SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE => 'SDL_MOUSE_EMULATE_WARP_WITH_RELATIVE';
2493 _const_and_export SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH => 'SDL_MOUSE_FOCUS_CLICKTHROUGH';
2494 _const_and_export SDL_HINT_MOUSE_NORMAL_SPEED_SCALE => 'SDL_MOUSE_NORMAL_SPEED_SCALE';
2495 _const_and_export SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => 'SDL_MOUSE_RELATIVE_MODE_CENTER';
2496 _const_and_export SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => 'SDL_MOUSE_RELATIVE_SPEED_SCALE';
2497 _const_and_export SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE => 'SDL_MOUSE_RELATIVE_SYSTEM_SCALE';
2498 _const_and_export SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => 'SDL_MOUSE_RELATIVE_WARP_MOTION';
2499 _const_and_export SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE => 'SDL_MOUSE_RELATIVE_CURSOR_VISIBLE';
2500 _const_and_export SDL_HINT_MOUSE_TOUCH_EVENTS => 'SDL_MOUSE_TOUCH_EVENTS';
2501 _const_and_export SDL_HINT_MUTE_CONSOLE_KEYBOARD => 'SDL_MUTE_CONSOLE_KEYBOARD';
2502 _const_and_export SDL_HINT_NO_SIGNAL_HANDLERS => 'SDL_NO_SIGNAL_HANDLERS';
2503 _const_and_export SDL_HINT_OPENGL_LIBRARY => 'SDL_OPENGL_LIBRARY';
2504 _const_and_export SDL_HINT_EGL_LIBRARY => 'SDL_EGL_LIBRARY';
2505 _const_and_export SDL_HINT_OPENGL_ES_DRIVER => 'SDL_OPENGL_ES_DRIVER';
2506 _const_and_export SDL_HINT_OPENVR_LIBRARY => 'SDL_OPENVR_LIBRARY';
2507 _const_and_export SDL_HINT_ORIENTATIONS => 'SDL_ORIENTATIONS';
2508 _const_and_export SDL_HINT_POLL_SENTINEL => 'SDL_POLL_SENTINEL';
2509 _const_and_export SDL_HINT_PREFERRED_LOCALES => 'SDL_PREFERRED_LOCALES';
2510 _const_and_export SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE => 'SDL_QUIT_ON_LAST_WINDOW_CLOSE';
2511 _const_and_export SDL_HINT_RENDER_DIRECT3D_THREADSAFE => 'SDL_RENDER_DIRECT3D_THREADSAFE';
2512 _const_and_export SDL_HINT_RENDER_DIRECT3D11_DEBUG => 'SDL_RENDER_DIRECT3D11_DEBUG';
2513 _const_and_export SDL_HINT_RENDER_DIRECT3D11_WARP => 'SDL_RENDER_DIRECT3D11_WARP';
2514 _const_and_export SDL_HINT_RENDER_VULKAN_DEBUG => 'SDL_RENDER_VULKAN_DEBUG';
2515 _const_and_export SDL_HINT_RENDER_GPU_DEBUG => 'SDL_RENDER_GPU_DEBUG';
2516 _const_and_export SDL_HINT_RENDER_GPU_LOW_POWER => 'SDL_RENDER_GPU_LOW_POWER';
2517 _const_and_export SDL_HINT_RENDER_DRIVER => 'SDL_RENDER_DRIVER';
2518 _const_and_export SDL_HINT_RENDER_LINE_METHOD => 'SDL_RENDER_LINE_METHOD';
2519 _const_and_export SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE => 'SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE';
2520 _const_and_export SDL_HINT_RENDER_VSYNC => 'SDL_RENDER_VSYNC';
2521 _const_and_export SDL_HINT_RETURN_KEY_HIDES_IME => 'SDL_RETURN_KEY_HIDES_IME';
2522 _const_and_export SDL_HINT_ROG_GAMEPAD_MICE => 'SDL_ROG_GAMEPAD_MICE';
2523 _const_and_export SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED => 'SDL_ROG_GAMEPAD_MICE_EXCLUDED';
2524 _const_and_export SDL_HINT_PS2_GS_WIDTH => 'SDL_PS2_GS_WIDTH';
2525 _const_and_export SDL_HINT_PS2_GS_HEIGHT => 'SDL_PS2_GS_HEIGHT';
2526 _const_and_export SDL_HINT_PS2_GS_PROGRESSIVE => 'SDL_PS2_GS_PROGRESSIVE';
2527 _const_and_export SDL_HINT_PS2_GS_MODE => 'SDL_PS2_GS_MODE';
2528 _const_and_export SDL_HINT_RPI_VIDEO_LAYER => 'SDL_RPI_VIDEO_LAYER';
2529 _const_and_export SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME => 'SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME';
2530 _const_and_export SDL_HINT_SHUTDOWN_DBUS_ON_QUIT => 'SDL_SHUTDOWN_DBUS_ON_QUIT';
2531 _const_and_export SDL_HINT_STORAGE_TITLE_DRIVER => 'SDL_STORAGE_TITLE_DRIVER';
2532 _const_and_export SDL_HINT_STORAGE_USER_DRIVER => 'SDL_STORAGE_USER_DRIVER';
2533 _const_and_export SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL => 'SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL';
2534 _const_and_export SDL_HINT_THREAD_PRIORITY_POLICY => 'SDL_THREAD_PRIORITY_POLICY';
2535 _const_and_export SDL_HINT_TIMER_RESOLUTION => 'SDL_TIMER_RESOLUTION';
2536 _const_and_export SDL_HINT_TOUCH_MOUSE_EVENTS => 'SDL_TOUCH_MOUSE_EVENTS';
2537 _const_and_export SDL_HINT_TRACKPAD_IS_TOUCH_ONLY => 'SDL_TRACKPAD_IS_TOUCH_ONLY';
2538 _const_and_export SDL_HINT_TV_REMOTE_AS_JOYSTICK => 'SDL_TV_REMOTE_AS_JOYSTICK';
2539 _const_and_export SDL_HINT_VIDEO_ALLOW_SCREENSAVER => 'SDL_VIDEO_ALLOW_SCREENSAVER';
2540 _const_and_export SDL_HINT_VIDEO_DISPLAY_PRIORITY => 'SDL_VIDEO_DISPLAY_PRIORITY';
2541 _const_and_export SDL_HINT_VIDEO_DOUBLE_BUFFER => 'SDL_VIDEO_DOUBLE_BUFFER';
2542 _const_and_export SDL_HINT_VIDEO_DRIVER => 'SDL_VIDEO_DRIVER';
2543 _const_and_export SDL_HINT_VIDEO_DUMMY_SAVE_FRAMES => 'SDL_VIDEO_DUMMY_SAVE_FRAMES';
2544 _const_and_export SDL_HINT_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK => 'SDL_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK';
2545 _const_and_export SDL_HINT_VIDEO_FORCE_EGL => 'SDL_VIDEO_FORCE_EGL';
2546 _const_and_export SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => 'SDL_VIDEO_MAC_FULLSCREEN_SPACES';
2547 _const_and_export SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY => 'SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY';
2548 _const_and_export SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE => 'SDL_VIDEO_METAL_AUTO_RESIZE_DRAWABLE';
2549 _const_and_export SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE => 'SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE';
2550 _const_and_export SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS => 'SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS';
2551 _const_and_export SDL_HINT_VIDEO_OFFSCREEN_SAVE_FRAMES => 'SDL_VIDEO_OFFSCREEN_SAVE_FRAMES';
2552 _const_and_export SDL_HINT_VIDEO_SYNC_WINDOW_OPERATIONS => 'SDL_VIDEO_SYNC_WINDOW_OPERATIONS';
2553 _const_and_export SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR => 'SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR';
2554 _const_and_export SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION => 'SDL_VIDEO_WAYLAND_MODE_EMULATION';
2555 _const_and_export SDL_HINT_VIDEO_WAYLAND_MODE_SCALING => 'SDL_VIDEO_WAYLAND_MODE_SCALING';
2556 _const_and_export SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR => 'SDL_VIDEO_WAYLAND_PREFER_LIBDECOR';
2557 _const_and_export SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY => 'SDL_VIDEO_WAYLAND_SCALE_TO_DISPLAY';
2558 _const_and_export SDL_HINT_VIDEO_WIN_D3DCOMPILER => 'SDL_VIDEO_WIN_D3DCOMPILER';
2559 _const_and_export SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT => 'SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT';
2560 _const_and_export SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR => 'SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR';
2561 _const_and_export SDL_HINT_VIDEO_X11_NET_WM_PING => 'SDL_VIDEO_X11_NET_WM_PING';
2562 _const_and_export SDL_HINT_VIDEO_X11_NODIRECTCOLOR => 'SDL_VIDEO_X11_NODIRECTCOLOR';
2563 _const_and_export SDL_HINT_VIDEO_X11_SCALING_FACTOR => 'SDL_VIDEO_X11_SCALING_FACTOR';
2564 _const_and_export SDL_HINT_VIDEO_X11_VISUALID => 'SDL_VIDEO_X11_VISUALID';
2565 _const_and_export SDL_HINT_VIDEO_X11_WINDOW_VISUALID => 'SDL_VIDEO_X11_WINDOW_VISUALID';
2566 _const_and_export SDL_HINT_VIDEO_X11_XRANDR => 'SDL_VIDEO_X11_XRANDR';
2567 _const_and_export SDL_HINT_VITA_ENABLE_BACK_TOUCH => 'SDL_VITA_ENABLE_BACK_TOUCH';
2568 _const_and_export SDL_HINT_VITA_ENABLE_FRONT_TOUCH => 'SDL_VITA_ENABLE_FRONT_TOUCH';
2569 _const_and_export SDL_HINT_VITA_MODULE_PATH => 'SDL_VITA_MODULE_PATH';
2570 _const_and_export SDL_HINT_VITA_PVR_INIT => 'SDL_VITA_PVR_INIT';
2571 _const_and_export SDL_HINT_VITA_RESOLUTION => 'SDL_VITA_RESOLUTION';
2572 _const_and_export SDL_HINT_VITA_PVR_OPENGL => 'SDL_VITA_PVR_OPENGL';
2573 _const_and_export SDL_HINT_VITA_TOUCH_MOUSE_DEVICE => 'SDL_VITA_TOUCH_MOUSE_DEVICE';
2574 _const_and_export SDL_HINT_VULKAN_DISPLAY => 'SDL_VULKAN_DISPLAY';
2575 _const_and_export SDL_HINT_VULKAN_LIBRARY => 'SDL_VULKAN_LIBRARY';
2576 _const_and_export SDL_HINT_WAVE_FACT_CHUNK => 'SDL_WAVE_FACT_CHUNK';
2577 _const_and_export SDL_HINT_WAVE_CHUNK_LIMIT => 'SDL_WAVE_CHUNK_LIMIT';
2578 _const_and_export SDL_HINT_WAVE_RIFF_CHUNK_SIZE => 'SDL_WAVE_RIFF_CHUNK_SIZE';
2579 _const_and_export SDL_HINT_WAVE_TRUNCATION => 'SDL_WAVE_TRUNCATION';
2580 _const_and_export SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED => 'SDL_WINDOW_ACTIVATE_WHEN_RAISED';
2581 _const_and_export SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN => 'SDL_WINDOW_ACTIVATE_WHEN_SHOWN';
2582 _const_and_export SDL_HINT_WINDOW_ALLOW_TOPMOST => 'SDL_WINDOW_ALLOW_TOPMOST';
2583 _const_and_export SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN => 'SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN';
2584 _const_and_export SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4 => 'SDL_WINDOWS_CLOSE_ON_ALT_F4';
2585 _const_and_export SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS => 'SDL_WINDOWS_ENABLE_MENU_MNEMONICS';
2586 _const_and_export SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => 'SDL_WINDOWS_ENABLE_MESSAGELOOP';
2587 _const_and_export SDL_HINT_WINDOWS_GAMEINPUT => 'SDL_WINDOWS_GAMEINPUT';
2588 _const_and_export SDL_HINT_WINDOWS_RAW_KEYBOARD => 'SDL_WINDOWS_RAW_KEYBOARD';
2589 _const_and_export SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS => 'SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS';
2590 _const_and_export SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => 'SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL';
2591 _const_and_export SDL_HINT_WINDOWS_INTRESOURCE_ICON => 'SDL_WINDOWS_INTRESOURCE_ICON';
2592 _const_and_export SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL => 'SDL_WINDOWS_INTRESOURCE_ICON_SMALL';
2593 _const_and_export SDL_HINT_WINDOWS_USE_D3D9EX => 'SDL_WINDOWS_USE_D3D9EX';
2594 _const_and_export SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE => 'SDL_WINDOWS_ERASE_BACKGROUND_MODE';
2595 _const_and_export SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => 'SDL_X11_FORCE_OVERRIDE_REDIRECT';
2596 _const_and_export SDL_HINT_X11_WINDOW_TYPE => 'SDL_X11_WINDOW_TYPE';
2597 _const_and_export SDL_HINT_X11_XCB_LIBRARY => 'SDL_X11_XCB_LIBRARY';
2598 _const_and_export SDL_HINT_XINPUT_ENABLED => 'SDL_XINPUT_ENABLED';
2599 _const_and_export SDL_HINT_ASSERT => 'SDL_ASSERT';
2600 _const_and_export SDL_HINT_PEN_MOUSE_EVENTS => 'SDL_PEN_MOUSE_EVENTS';
2601 _const_and_export SDL_HINT_PEN_TOUCH_EVENTS => 'SDL_PEN_TOUCH_EVENTS';
2602 _enum_and_export SDL_HintPriority => [ 'SDL_HINT_DEFAULT', 'SDL_HINT_NORMAL', 'SDL_HINT_OVERRIDE' ];
2603 _affix_and_export SDL_SetHintWithPriority => [ String, String, SDL_HintPriority() ], Bool;
2604 _affix_and_export SDL_SetHint => [ String, String ], Bool;
2605 _affix_and_export SDL_ResetHint => [String], Bool;
2606 _affix_and_export SDL_ResetHints => [], Void;
2607 _affix_and_export SDL_GetHint => [String], String;
2608 _affix_and_export SDL_GetHintBoolean => [ String, Bool ], Bool;
2609 _typedef_and_export SDL_HintCallback => Callback [ [ Pointer [Void], String, String, String ] => Void ];
2610 _affix_and_export SDL_AddHintCallback => [ String, SDL_HintCallback(), Pointer [Void] ], Bool;
2611 _affix_and_export SDL_RemoveHintCallback => [ String, SDL_HintCallback(), Pointer [Void] ], Void;
2612 }
2613
2614 =head3 C<:init> - Initialization and Shutdown
2615
2616 All SDL programs need to initialize the library before starting to work with it.
2617
2618 See L<SDL3: CategoryInit|https://wiki.libsdl.org/SDL3/CategoryInit>
2619
2620 =cut
2621
2622 sub _init() { # Based on sdl-main/include/sdl3/sdl_init.h
2623 state $done++ && return;
2624 _stdinc();
2625 _error();
2626 _events();
2627 #
2628 _typedef_and_export SDL_InitFlags => UInt32;
2629 _const_and_export SDL_INIT_AUDIO => 0x00000010;
2630 _const_and_export SDL_INIT_VIDEO => 0x00000020;
2631 _const_and_export SDL_INIT_JOYSTICK => 0x00000200;
2632 _const_and_export SDL_INIT_HAPTIC => 0x00001000;
2633 _const_and_export SDL_INIT_GAMEPAD => 0x00002000;
2634 _const_and_export SDL_INIT_EVENTS => 0x00004000;
2635 _const_and_export SDL_INIT_SENSOR => 0x00008000;
2636 _const_and_export SDL_INIT_CAMERA => 0x00010000;
2637 _enum_and_export SDL_AppResult => [ [ SDL_APP_CONTINUE => 0 ], [ SDL_APP_SUCCESS => 1 ], [ SDL_APP_FAILURE => 2 ] ];
2638 _typedef_and_export SDL_AppInit_func => Callback [ [ Pointer [ Pointer [Void] ], Int, Pointer [String] ] => SDL_AppResult() ];
2639 _typedef_and_export SDL_AppIterate_func => Callback [ [ Pointer [Void] ] => SDL_AppResult() ];
2640 _typedef_and_export SDL_AppEvent_func => Callback [ [ Pointer [Void], Pointer [ SDL_Event() ] ] => SDL_AppResult() ];
2641 _typedef_and_export SDL_AppQuit_func => Callback [ [ Pointer [Void], SDL_AppResult() ] => Void ];
2642 _affix_and_export SDL_Init => [ SDL_InitFlags() ], Bool;
2643 _affix_and_export SDL_InitSubSystem => [ SDL_InitFlags() ], Bool;
2644 _affix_and_export SDL_QuitSubSystem => [ SDL_InitFlags() ], Void;
2645 _affix_and_export SDL_WasInit => [ SDL_InitFlags() ], SDL_InitFlags();
2646 _affix_and_export SDL_Quit => [], Void;
2647 _affix_and_export SDL_IsMainThread => [], Bool;
2648 _typedef_and_export SDL_MainThreadCallback => Callback [ [ Pointer [Void] ] => Void ];
2649 _affix_and_export SDL_RunOnMainThread => [ SDL_MainThreadCallback(), Pointer [Void], Bool ], Bool;
2650 _affix_and_export SDL_SetAppMetadata => [ String, String, String ], Bool;
2651 _affix_and_export SDL_SetAppMetadataProperty => [ String, String ], Bool;
2652 _const_and_export SDL_PROP_APP_METADATA_NAME_STRING => 'SDL.app.metadata.name';
2653 _const_and_export SDL_PROP_APP_METADATA_VERSION_STRING => 'SDL.app.metadata.version';
2654 _const_and_export SDL_PROP_APP_METADATA_IDENTIFIER_STRING => 'SDL.app.metadata.identifier';
2655 _const_and_export SDL_PROP_APP_METADATA_CREATOR_STRING => 'SDL.app.metadata.creator';
2656 _const_and_export SDL_PROP_APP_METADATA_COPYRIGHT_STRING => 'SDL.app.metadata.copyright';
2657 _const_and_export SDL_PROP_APP_METADATA_URL_STRING => 'SDL.app.metadata.url';
2658 _const_and_export SDL_PROP_APP_METADATA_TYPE_STRING => 'SDL.app.metadata.type';
2659 _affix_and_export SDL_GetAppMetadataProperty => [String], String;
2660 }
2661
2662 =head3 C<:iostream> - I/O Streams
2663
2664 SDL provides an abstract interface for reading and writing data streams. It offers implementations for files, memory,
2665 etc, and the app can provide their own implementations, too.
2666
2667 SDL_IOStream is not related to the standard C++ iostream class, other than both are abstract interfaces to read/write
2668 data.
2669
2670 See L<SDL3: CategoryIOStream|https://wiki.libsdl.org/SDL3/CategoryIOStream>
2671
2672 =cut
2673
2674 sub _iostream() {
2675 state $done++ && return;
2676 _error();
2677 _properties();
2678 _stdinc();
2679 #
2680 _enum_and_export SDL_IOStatus => [
2681 'SDL_IO_STATUS_READY', 'SDL_IO_STATUS_ERROR', 'SDL_IO_STATUS_EOF', 'SDL_IO_STATUS_NOT_READY',
2682 'SDL_IO_STATUS_READONLY', 'SDL_IO_STATUS_WRITEONLY'
2683 ];
2684 _enum_and_export SDL_IOWhence => [ 'SDL_IO_SEEK_SET', 'SDL_IO_SEEK_CUR', 'SDL_IO_SEEK_END' ];
2685 _typedef_and_export SDL_IOStreamInterface => Struct [
2686 version => UInt32,
2687 size => Callback [ [ Pointer [Void] ] => SInt64 ],
2688 seek => Callback [ [ Pointer [Void], SInt64, SDL_IOWhence() ] => SInt64 ],
2689 read => Callback [ [ Pointer [Void], Pointer [Void], Size_t, Pointer [ SDL_IOStatus() ] ] => Size_t ],
2690 write => Callback [ [ Pointer [Void], Pointer [Void], Size_t, Pointer [ SDL_IOStatus() ] ] => Size_t ],
2691 flush => Callback [ [ Pointer [Void], Pointer [ SDL_IOStatus() ] ] => Bool ],
2692 close => Callback [ [ Pointer [Void] ] => Bool ]
2693 ];
2694 _typedef_and_export SDL_IOStream => Void;
2695 _affix_and_export SDL_IOFromFile => [ String, String ], Pointer [ SDL_IOStream() ];
2696 _const_and_export SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER => 'SDL.iostream.windows.handle';
2697 _const_and_export SDL_PROP_IOSTREAM_STDIO_FILE_POINTER => 'SDL.iostream.stdio.file';
2698 _const_and_export SDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER => 'SDL.iostream.file_descriptor';
2699 _const_and_export SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER => 'SDL.iostream.android.aasset';
2700 _affix_and_export SDL_IOFromMem => [ Pointer [Void], Size_t ], Pointer [ SDL_IOStream() ];
2701 _const_and_export SDL_PROP_IOSTREAM_MEMORY_POINTER => 'SDL.iostream.memory.base';
2702 _const_and_export SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER => 'SDL.iostream.memory.size';
2703 _const_and_export SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER => 'SDL.iostream.memory.free';
2704 _affix_and_export SDL_IOFromConstMem => [ Pointer [Void], Size_t ], Pointer [ SDL_IOStream() ];
2705 _affix_and_export SDL_IOFromDynamicMem => [], Pointer [ SDL_IOStream() ];
2706 _const_and_export SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER => 'SDL.iostream.dynamic.memory';
2707 _const_and_export SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER => 'SDL.iostream.dynamic.chunksize';
2708 _affix_and_export
2709 SDL_OpenIO => [ Pointer [ SDL_IOStreamInterface() ], Pointer [Void] ],
2710 Pointer [ SDL_IOStream() ];
2711 _affix_and_export SDL_CloseIO => [ Pointer [ SDL_IOStream() ] ], Bool;
2712 _affix_and_export SDL_GetIOProperties => [ Pointer [ SDL_IOStream() ] ], SDL_PropertiesID();
2713 _affix_and_export SDL_GetIOStatus => [ Pointer [ SDL_IOStream() ] ], SDL_IOStatus();
2714 _affix_and_export SDL_GetIOSize => [ Pointer [ SDL_IOStream() ] ], SInt64;
2715 _affix_and_export SDL_SeekIO => [ Pointer [ SDL_IOStream() ], SInt64, SDL_IOWhence() ], SInt64;
2716 _affix_and_export SDL_TellIO => [ Pointer [ SDL_IOStream() ] ], SInt64;
2717 _affix_and_export SDL_ReadIO => [ Pointer [ SDL_IOStream() ], Pointer [Void], Size_t ], Size_t;
2718 _affix_and_export SDL_WriteIO => [ Pointer [ SDL_IOStream() ], Pointer [Void], Size_t ], Size_t;
2719
2720 #~ _affix_and_export SDL_IOprintf => [ Pointer [ SDL_IOStream() ], String, VarArgs ], Size_t;
2721 #~ _affix_and_export SDL_IOvprintf => [ Pointer [ SDL_IOStream() ], String, Pointer [Void] ], Size_t;
2722 _affix_and_export SDL_FlushIO => [ Pointer [ SDL_IOStream() ] ], Bool;
2723 _affix_and_export SDL_LoadFile_IO => [ Pointer [ SDL_IOStream() ], Pointer [Size_t], Bool ], Pointer [Void];
2724 _affix_and_export SDL_LoadFile => [ String, Pointer [Size_t] ], Pointer [Void];
2725 _affix_and_export SDL_SaveFile_IO => [ Pointer [ SDL_IOStream() ], Pointer [Void], Size_t, Bool ], Bool;
2726 _affix_and_export SDL_SaveFile => [ String, Pointer [Void], Size_t ], Bool;
2727 _affix_and_export SDL_ReadU8 => [ Pointer [ SDL_IOStream() ], Pointer [UInt8] ], Bool;
2728 _affix_and_export SDL_ReadS8 => [ Pointer [ SDL_IOStream() ], Pointer [SInt8] ], Bool;
2729 _affix_and_export SDL_ReadU16LE => [ Pointer [ SDL_IOStream() ], Pointer [UInt16] ], Bool;
2730 _affix_and_export SDL_ReadS16LE => [ Pointer [ SDL_IOStream() ], Pointer [SInt16] ], Bool;
2731 _affix_and_export SDL_ReadU16BE => [ Pointer [ SDL_IOStream() ], Pointer [UInt16] ], Bool;
2732 _affix_and_export SDL_ReadS16BE => [ Pointer [ SDL_IOStream() ], Pointer [SInt16] ], Bool;
2733 _affix_and_export SDL_ReadU32LE => [ Pointer [ SDL_IOStream() ], Pointer [UInt32] ], Bool;
2734 _affix_and_export SDL_ReadS32LE => [ Pointer [ SDL_IOStream() ], Pointer [SInt32] ], Bool;
2735 _affix_and_export SDL_ReadU32BE => [ Pointer [ SDL_IOStream() ], Pointer [UInt32] ], Bool;
2736 _affix_and_export SDL_ReadS32BE => [ Pointer [ SDL_IOStream() ], Pointer [SInt32] ], Bool;
2737 _affix_and_export SDL_ReadU64LE => [ Pointer [ SDL_IOStream() ], Pointer [UInt64] ], Bool;
2738 _affix_and_export SDL_ReadS64LE => [ Pointer [ SDL_IOStream() ], Pointer [SInt64] ], Bool;
2739 _affix_and_export SDL_ReadU64BE => [ Pointer [ SDL_IOStream() ], Pointer [UInt64] ], Bool;
2740 _affix_and_export SDL_ReadS64BE => [ Pointer [ SDL_IOStream() ], Pointer [SInt64] ], Bool;
2741 _affix_and_export SDL_WriteU8 => [ Pointer [ SDL_IOStream() ], UInt8 ], Bool;
2742 _affix_and_export SDL_WriteS8 => [ Pointer [ SDL_IOStream() ], SInt8 ], Bool;
2743 _affix_and_export SDL_WriteU16LE => [ Pointer [ SDL_IOStream() ], UInt16 ], Bool;
2744 _affix_and_export SDL_WriteS16LE => [ Pointer [ SDL_IOStream() ], SInt16 ], Bool;
2745 _affix_and_export SDL_WriteU16BE => [ Pointer [ SDL_IOStream() ], UInt16 ], Bool;
2746 _affix_and_export SDL_WriteS16BE => [ Pointer [ SDL_IOStream() ], SInt16 ], Bool;
2747 _affix_and_export SDL_WriteU32LE => [ Pointer [ SDL_IOStream() ], UInt32 ], Bool;
2748 _affix_and_export SDL_WriteS32LE => [ Pointer [ SDL_IOStream() ], SInt32 ], Bool;
2749 _affix_and_export SDL_WriteU32BE => [ Pointer [ SDL_IOStream() ], UInt32 ], Bool;
2750 _affix_and_export SDL_WriteS32BE => [ Pointer [ SDL_IOStream() ], SInt32 ], Bool;
2751 _affix_and_export SDL_WriteU64LE => [ Pointer [ SDL_IOStream() ], UInt64 ], Bool;
2752 _affix_and_export SDL_WriteS64LE => [ Pointer [ SDL_IOStream() ], SInt64 ], Bool;
2753 _affix_and_export SDL_WriteU64BE => [ Pointer [ SDL_IOStream() ], UInt64 ], Bool;
2754 _affix_and_export SDL_WriteS64BE => [ Pointer [ SDL_IOStream() ], SInt64 ], Bool;
2755 }
2756
2757 =head3 C<:joystick> - Joystick Support
2758
2759 SDL joystick support.
2760
2761 This is the lower-level joystick handling. If you want the simpler option, where what each button does is well-defined,
2762 you should use the gamepad API instead.
2763
2764 See L<SDL3: CategoryJoystick|https://wiki.libsdl.org/SDL3/CategoryJoystick>
2765
2766 =cut
2767
2768 sub _joystick() {
2769 state $done++ && return;
2770 _error();
2771 _guid();
2772 _mutex();
2773 _power();
2774 _properties();
2775 _sensor();
2776 _stdinc();
2777 #
2778 _typedef_and_export SDL_Joystick => Void;
2779 _typedef_and_export SDL_JoystickID => UInt32;
2780 _enum_and_export SDL_JoystickType => [
2781 'SDL_JOYSTICK_TYPE_UNKNOWN', 'SDL_JOYSTICK_TYPE_GAMEPAD', 'SDL_JOYSTICK_TYPE_WHEEL', 'SDL_JOYSTICK_TYPE_ARCADE_STICK',
2782 'SDL_JOYSTICK_TYPE_FLIGHT_STICK', 'SDL_JOYSTICK_TYPE_DANCE_PAD', 'SDL_JOYSTICK_TYPE_GUITAR', 'SDL_JOYSTICK_TYPE_DRUM_KIT',
2783 'SDL_JOYSTICK_TYPE_ARCADE_PAD', 'SDL_JOYSTICK_TYPE_THROTTLE', 'SDL_JOYSTICK_TYPE_COUNT'
2784 ];
2785 _enum_and_export SDL_JoystickConnectionState => [
2786 [ SDL_JOYSTICK_CONNECTION_INVALID => -1 ], 'SDL_JOYSTICK_CONNECTION_UNKNOWN',
2787 'SDL_JOYSTICK_CONNECTION_WIRED', 'SDL_JOYSTICK_CONNECTION_WIRELESS'
2788 ];
2789 _const_and_export SDL_JOYSTICK_AXIS_MAX => 32767;
2790 _const_and_export SDL_JOYSTICK_AXIS_MIN => -32768;
2791 _affix_and_export SDL_LockJoysticks => [], Void;
2792 _affix_and_export SDL_UnlockJoysticks => [], Void;
2793 _affix_and_export SDL_HasJoystick => [], Bool;
2794 _affix_and_export SDL_GetJoysticks => [ Pointer [Int] ], Pointer [ SDL_JoystickID() ];
2795 _affix_and_export SDL_GetJoystickNameForID => [ SDL_JoystickID() ], String;
2796 _affix_and_export SDL_GetJoystickPathForID => [ SDL_JoystickID() ], String;
2797 _affix_and_export SDL_GetJoystickPlayerIndexForID => [ SDL_JoystickID() ], Int;
2798 _affix_and_export SDL_GetJoystickGUIDForID => [ SDL_JoystickID() ], SDL_GUID();
2799 _affix_and_export SDL_GetJoystickVendorForID => [ SDL_JoystickID() ], UInt16;
2800 _affix_and_export SDL_GetJoystickProductForID => [ SDL_JoystickID() ], UInt16;
2801 _affix_and_export SDL_GetJoystickProductVersionForID => [ SDL_JoystickID() ], UInt16;
2802 _affix_and_export SDL_GetJoystickTypeForID => [ SDL_JoystickID() ], SDL_JoystickType();
2803 _affix_and_export SDL_OpenJoystick => [ SDL_JoystickID() ], Pointer [ SDL_Joystick() ];
2804 _affix_and_export SDL_GetJoystickFromID => [ SDL_JoystickID() ], Pointer [ SDL_Joystick() ];
2805 _affix_and_export SDL_GetJoystickFromPlayerIndex => [Int], Pointer [ SDL_Joystick() ];
2806 _typedef_and_export SDL_VirtualJoystickTouchpadDesc => Struct [ nfingers => UInt16, padding => Array [ UInt16, 3 ] ];
2807 _typedef_and_export SDL_VirtualJoystickSensorDesc => Struct [ type => SDL_SensorType(), rate => Float ];
2808 _typedef_and_export SDL_VirtualJoystickDesc => Struct [
2809 version => UInt32,
2810 type => UInt16,
2811 padding => UInt16,
2812 vendor_id => UInt16,
2813 product_id => UInt16,
2814 naxes => UInt16,
2815 nbuttons => UInt16,
2816 nballs => UInt16,
2817 nhats => UInt16,
2818 ntouchpads => UInt16,
2819 nsensors => UInt16,
2820 padding2 => Array [ UInt16, 2 ],
2821 button_mask => UInt32,
2822 axis_mask => UInt32,
2823 name => String,
2824 touchpads => Pointer [ SDL_VirtualJoystickTouchpadDesc() ],
2825 sensors => Pointer [ SDL_VirtualJoystickSensorDesc() ],
2826 userdata => Pointer [Void],
2827 Update => Callback [ [ Pointer [Void] ] => Void ],
2828 SetPlayerIndex => Callback [ [ Pointer [Void], Int ] => Void ],
2829 Rumble => Callback [ [ Pointer [Void], UInt16, UInt16 ] => Bool ],
2830 RumbleTriggers => Callback [ [ Pointer [Void], UInt16, UInt16 ] => Bool ],
2831 SetLED => Callback [ [ Pointer [Void], UInt8, UInt8, UInt8 ] => Bool ],
2832 SendEffect => Callback [ [ Pointer [Void], Pointer [Void], Int ] => Bool ],
2833 SetSensorsEnabled => Callback [ [ Pointer [Void], Bool ] => Bool ],
2834 Cleanup => Callback [ [ Pointer [Void] ] => Void ]
2835 ];
2836 _affix_and_export SDL_AttachVirtualJoystick => [ Pointer [ SDL_VirtualJoystickDesc() ] ], SDL_JoystickID();
2837 _affix_and_export SDL_DetachVirtualJoystick => [ SDL_JoystickID() ], Bool;
2838 _affix_and_export SDL_IsJoystickVirtual => [ SDL_JoystickID() ], Bool;
2839 _affix_and_export SDL_SetJoystickVirtualAxis => [ Pointer [ SDL_Joystick() ], Int, SInt16 ], Bool;
2840 _affix_and_export SDL_SetJoystickVirtualBall => [ Pointer [ SDL_Joystick() ], Int, SInt16, SInt16 ], Bool;
2841 _affix_and_export SDL_SetJoystickVirtualButton => [ Pointer [ SDL_Joystick() ], Int, Bool ], Bool;
2842 _affix_and_export SDL_SetJoystickVirtualHat => [ Pointer [ SDL_Joystick() ], Int, UInt8 ], Bool;
2843 _affix_and_export SDL_SetJoystickVirtualTouchpad => [ Pointer [ SDL_Joystick() ], Int, Int, Bool, Float, Float, Float ], Bool;
2844 _affix_and_export
2845 SDL_SendJoystickVirtualSensorData => [ Pointer [ SDL_Joystick() ], SDL_SensorType(), UInt64, Pointer [Float], Int ],
2846 Bool;
2847 _affix_and_export SDL_GetJoystickProperties => [ Pointer [ SDL_Joystick() ] ], SDL_PropertiesID();
2848 _const_and_export SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN => 'SDL.joystick.cap.mono_led';
2849 _const_and_export SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN => 'SDL.joystick.cap.rgb_led';
2850 _const_and_export SDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN => 'SDL.joystick.cap.player_led';
2851 _const_and_export SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN => 'SDL.joystick.cap.rumble';
2852 _const_and_export SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN => 'SDL.joystick.cap.trigger_rumble';
2853 _affix_and_export SDL_GetJoystickName => [ Pointer [ SDL_Joystick() ] ], String;
2854 _affix_and_export SDL_GetJoystickPath => [ Pointer [ SDL_Joystick() ] ], String;
2855 _affix_and_export SDL_GetJoystickPlayerIndex => [ Pointer [ SDL_Joystick() ] ], Int;
2856 _affix_and_export SDL_SetJoystickPlayerIndex => [ Pointer [ SDL_Joystick() ], Int ], Bool;
2857 _affix_and_export SDL_GetJoystickGUID => [ Pointer [ SDL_Joystick() ] ], SDL_GUID();
2858 _affix_and_export SDL_GetJoystickVendor => [ Pointer [ SDL_Joystick() ] ], UInt16;
2859 _affix_and_export SDL_GetJoystickProduct => [ Pointer [ SDL_Joystick() ] ], UInt16;
2860 _affix_and_export SDL_GetJoystickProductVersion => [ Pointer [ SDL_Joystick() ] ], UInt16;
2861 _affix_and_export SDL_GetJoystickFirmwareVersion => [ Pointer [ SDL_Joystick() ] ], UInt16;
2862 _affix_and_export SDL_GetJoystickSerial => [ Pointer [ SDL_Joystick() ] ], String;
2863 _affix_and_export SDL_GetJoystickType => [ Pointer [ SDL_Joystick() ] ], SDL_JoystickType();
2864 _affix_and_export
2865 SDL_GetJoystickGUIDInfo => [ SDL_GUID(), Pointer [UInt16], Pointer [UInt16], Pointer [UInt16], Pointer [UInt16] ],
2866 Void;
2867 _affix_and_export SDL_JoystickConnected => [ Pointer [ SDL_Joystick() ] ], Bool;
2868 _affix_and_export SDL_GetJoystickID => [ Pointer [ SDL_Joystick() ] ], SDL_JoystickID();
2869 _affix_and_export SDL_GetNumJoystickAxes => [ Pointer [ SDL_Joystick() ] ], Int;
2870 _affix_and_export SDL_GetNumJoystickBalls => [ Pointer [ SDL_Joystick() ] ], Int;
2871 _affix_and_export SDL_GetNumJoystickHats => [ Pointer [ SDL_Joystick() ] ], Int;
2872 _affix_and_export SDL_GetNumJoystickButtons => [ Pointer [ SDL_Joystick() ] ], Int;
2873 _affix_and_export SDL_SetJoystickEventsEnabled => [Bool], Void;
2874 _affix_and_export SDL_JoystickEventsEnabled => [], Bool;
2875 _affix_and_export SDL_UpdateJoysticks => [], Void;
2876 _affix_and_export SDL_GetJoystickAxis => [ Pointer [ SDL_Joystick() ], Int ], SInt16;
2877 _affix_and_export SDL_GetJoystickAxisInitialState => [ Pointer [ SDL_Joystick() ], Int, Pointer [SInt16] ], Bool;
2878 _affix_and_export SDL_GetJoystickBall => [ Pointer [ SDL_Joystick() ], Int, Pointer [Int], Pointer [Int] ], Bool;
2879 _affix_and_export SDL_GetJoystickHat => [ Pointer [ SDL_Joystick() ], Int ], UInt8;
2880 _const_and_export SDL_HAT_CENTERED => 0x00;
2881 _const_and_export SDL_HAT_UP => 0x01;
2882 _const_and_export SDL_HAT_RIGHT => 0x02;
2883 _const_and_export SDL_HAT_DOWN => 0x04;
2884 _const_and_export SDL_HAT_LEFT => 0x08;
2885 _const_and_export SDL_HAT_RIGHTUP => 0x03;
2886 _const_and_export SDL_HAT_RIGHTDOWN => 0x06;
2887 _const_and_export SDL_HAT_LEFTUP => 0x09;
2888 _const_and_export SDL_HAT_LEFTDOWN => 0x0C;
2889 _affix_and_export SDL_GetJoystickButton => [ Pointer [ SDL_Joystick() ], Int ], Bool;
2890 _affix_and_export SDL_RumbleJoystick => [ Pointer [ SDL_Joystick() ], UInt16, UInt16, UInt32 ], Bool;
2891 _affix_and_export SDL_RumbleJoystickTriggers => [ Pointer [ SDL_Joystick() ], UInt16, UInt16, UInt32 ], Bool;
2892 _affix_and_export SDL_SetJoystickLED => [ Pointer [ SDL_Joystick() ], UInt8, UInt8, UInt8 ], Bool;
2893 _affix_and_export SDL_SendJoystickEffect => [ Pointer [ SDL_Joystick() ], Pointer [Void], Int ], Bool;
2894 _affix_and_export SDL_CloseJoystick => [ Pointer [ SDL_Joystick() ] ], Void;
2895 _affix_and_export SDL_GetJoystickConnectionState => [ Pointer [ SDL_Joystick() ] ], SDL_JoystickConnectionState();
2896 _affix_and_export SDL_GetJoystickPowerInfo => [ Pointer [ SDL_Joystick() ], Pointer [Int] ], SDL_PowerState();
2897 }
2898
2899 =head3 C<:keyboard> - Keyboard Support
2900
2901 SDL keyboard management.
2902
2903 See L<SDL3: CategoryKeyboard|https://wiki.libsdl.org/SDL3/CategoryKeyboard>
2904
2905 =cut
2906
2907 sub _keyboard() {
2908 state $done++ && return;
2909 _error();
2910 _keycode();
2911 _properties();
2912 _rect();
2913 _scancode();
2914 _stdinc();
2915 _video();
2916 #
2917 _typedef_and_export SDL_KeyboardID => UInt32;
2918 _affix_and_export SDL_HasKeyboard => [], Bool;
2919 _affix_and_export SDL_GetKeyboards => [ Pointer [Int] ], Pointer [ SDL_KeyboardID() ];
2920 _affix_and_export SDL_GetKeyboardNameForID => [ SDL_KeyboardID() ], String;
2921 _affix_and_export SDL_GetKeyboardFocus => [], Pointer [ SDL_Window() ];
2922 _affix_and_export SDL_GetKeyboardState => [ Pointer [Int] ], Pointer [Bool];
2923 _affix_and_export SDL_ResetKeyboard => [], Void;
2924 _affix_and_export SDL_GetModState => [], SDL_Keymod();
2925 _affix_and_export SDL_SetModState => [ SDL_Keymod() ], Void;
2926 _affix_and_export SDL_GetKeyFromScancode => [ SDL_Scancode(), SDL_Keymod(), Bool ], SDL_Keycode();
2927 _affix_and_export SDL_GetScancodeFromKey => [ SDL_Keycode(), Pointer [ SDL_Keymod() ] ], SDL_Scancode();
2928 _affix_and_export SDL_SetScancodeName => [ SDL_Scancode(), String ], Bool;
2929 _affix_and_export SDL_GetScancodeName => [ SDL_Scancode() ], String;
2930 _affix_and_export SDL_GetScancodeFromName => [String], SDL_Scancode();
2931 _affix_and_export SDL_GetKeyName => [ SDL_Keycode() ], String;
2932 _affix_and_export SDL_GetKeyFromName => [String], SDL_Keycode();
2933 _affix_and_export SDL_StartTextInput => [ Pointer [ SDL_Window() ] ], Bool;
2934 _enum_and_export SDL_TextInputType => [
2935 'SDL_TEXTINPUT_TYPE_TEXT', 'SDL_TEXTINPUT_TYPE_TEXT_NAME',
2936 'SDL_TEXTINPUT_TYPE_TEXT_EMAIL', 'SDL_TEXTINPUT_TYPE_TEXT_USERNAME',
2937 'SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN', 'SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE',
2938 'SDL_TEXTINPUT_TYPE_NUMBER', 'SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN',
2939 'SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE'
2940 ];
2941 _enum_and_export SDL_Capitalization =>
2942 [ 'SDL_CAPITALIZE_NONE', 'SDL_CAPITALIZE_SENTENCES', 'SDL_CAPITALIZE_WORDS', 'SDL_CAPITALIZE_LETTERS' ];
2943 _affix_and_export SDL_StartTextInputWithProperties => [ Pointer [ SDL_Window() ], SDL_PropertiesID() ], Bool;
2944 _const_and_export SDL_PROP_TEXTINPUT_TYPE_NUMBER => 'SDL.textinput.type';
2945 _const_and_export SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER => 'SDL.textinput.capitalization';
2946 _const_and_export SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN => 'SDL.textinput.autocorrect';
2947 _const_and_export SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN => 'SDL.textinput.multiline';
2948 _const_and_export SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER => 'SDL.textinput.android.inputtype';
2949 _affix_and_export SDL_TextInputActive => [ Pointer [ SDL_Window() ] ], Bool;
2950 _affix_and_export SDL_StopTextInput => [ Pointer [ SDL_Window() ] ], Bool;
2951 _affix_and_export SDL_ClearComposition => [ Pointer [ SDL_Window() ] ], Bool;
2952 _affix_and_export SDL_SetTextInputArea => [ Pointer [ SDL_Window() ], Pointer [ SDL_Rect() ], Int ], Bool;
2953 _affix_and_export SDL_GetTextInputArea => [ Pointer [ SDL_Window() ], Pointer [ SDL_Rect() ], Pointer [Int] ], Bool;
2954 _affix_and_export SDL_HasScreenKeyboardSupport => [], Bool;
2955 _affix_and_export SDL_ScreenKeyboardShown => [ Pointer [ SDL_Window() ] ], Bool;
2956 }
2957
2958 =head3 C<:keycode> - Keyboard Keycodes
2959
2960 Defines constants which identify keyboard keys and modifiers.
2961
2962 See L<SDL3: CategoryKeycode|https://wiki.libsdl.org/SDL3/CategoryKeycode>
2963
2964 =cut
2965
2966 sub _keycode() { # Based on sdl-main/include/sdl3/sdl_keycode.h
2967 state $done++ && return;
2968 #
2969 _scancode();
2970 _stdinc();
2971 #
2972 _typedef_and_export SDL_Keycode => UInt32;
2973 _const_and_export SDLK_EXTENDED_MASK => ( 1 << 29 );
2974 _const_and_export SDLK_SCANCODE_MASK => ( 1 << 30 );
2975 _func_and_export( SDL_SCANCODE_TO_KEYCODE => sub ($X) { ( $X | SDLK_SCANCODE_MASK() ) } );
2976 _const_and_export SDLK_UNKNOWN => 0x00000000;
2977 _const_and_export SDLK_RETURN => 0x0000000d;
2978 _const_and_export SDLK_ESCAPE => 0x0000001b;
2979 _const_and_export SDLK_BACKSPACE => 0x00000008;
2980 _const_and_export SDLK_TAB => 0x00000009;
2981 _const_and_export SDLK_SPACE => 0x00000020;
2982 _const_and_export SDLK_EXCLAIM => 0x00000021;
2983 _const_and_export SDLK_DBLAPOSTROPHE => 0x00000022;
2984 _const_and_export SDLK_HASH => 0x00000023;
2985 _const_and_export SDLK_DOLLAR => 0x00000024;
2986 _const_and_export SDLK_PERCENT => 0x00000025;
2987 _const_and_export SDLK_AMPERSAND => 0x00000026;
2988 _const_and_export SDLK_APOSTROPHE => 0x00000027;
2989 _const_and_export SDLK_LEFTPAREN => 0x00000028;
2990 _const_and_export SDLK_RIGHTPAREN => 0x00000029;
2991 _const_and_export SDLK_ASTERISK => 0x0000002a;
2992 _const_and_export SDLK_PLUS => 0x0000002b;
2993 _const_and_export SDLK_COMMA => 0x0000002c;
2994 _const_and_export SDLK_MINUS => 0x0000002d;
2995 _const_and_export SDLK_PERIOD => 0x0000002e;
2996 _const_and_export SDLK_SLASH => 0x0000002f;
2997 _const_and_export SDLK_0 => 0x00000030;
2998 _const_and_export SDLK_1 => 0x00000031;
2999 _const_and_export SDLK_2 => 0x00000032;
3000 _const_and_export SDLK_3 => 0x00000033;
3001 _const_and_export SDLK_4 => 0x00000034;
3002 _const_and_export SDLK_5 => 0x00000035;
3003 _const_and_export SDLK_6 => 0x00000036;
3004 _const_and_export SDLK_7 => 0x00000037;
3005 _const_and_export SDLK_8 => 0x00000038;
3006 _const_and_export SDLK_9 => 0x00000039;
3007 _const_and_export SDLK_COLON => 0x0000003a;
3008 _const_and_export SDLK_SEMICOLON => 0x0000003b;
3009 _const_and_export SDLK_LESS => 0x0000003c;
3010 _const_and_export SDLK_EQUALS => 0x0000003d;
3011 _const_and_export SDLK_GREATER => 0x0000003e;
3012 _const_and_export SDLK_QUESTION => 0x0000003f;
3013 _const_and_export SDLK_AT => 0x00000040;
3014 _const_and_export SDLK_LEFTBRACKET => 0x0000005b;
3015 _const_and_export SDLK_BACKSLASH => 0x0000005c;
3016 _const_and_export SDLK_RIGHTBRACKET => 0x0000005d;
3017 _const_and_export SDLK_CARET => 0x0000005e;
3018 _const_and_export SDLK_UNDERSCORE => 0x0000005f;
3019 _const_and_export SDLK_GRAVE => 0x00000060;
3020 _const_and_export SDLK_A => 0x00000061;
3021 _const_and_export SDLK_B => 0x00000062;
3022 _const_and_export SDLK_C => 0x00000063;
3023 _const_and_export SDLK_D => 0x00000064;
3024 _const_and_export SDLK_E => 0x00000065;
3025 _const_and_export SDLK_F => 0x00000066;
3026 _const_and_export SDLK_G => 0x00000067;
3027 _const_and_export SDLK_H => 0x00000068;
3028 _const_and_export SDLK_I => 0x00000069;
3029 _const_and_export SDLK_J => 0x0000006a;
3030 _const_and_export SDLK_K => 0x0000006b;
3031 _const_and_export SDLK_L => 0x0000006c;
3032 _const_and_export SDLK_M => 0x0000006d;
3033 _const_and_export SDLK_N => 0x0000006e;
3034 _const_and_export SDLK_O => 0x0000006f;
3035 _const_and_export SDLK_P => 0x00000070;
3036 _const_and_export SDLK_Q => 0x00000071;
3037 _const_and_export SDLK_R => 0x00000072;
3038 _const_and_export SDLK_S => 0x00000073;
3039 _const_and_export SDLK_T => 0x00000074;
3040 _const_and_export SDLK_U => 0x00000075;
3041 _const_and_export SDLK_V => 0x00000076;
3042 _const_and_export SDLK_W => 0x00000077;
3043 _const_and_export SDLK_X => 0x00000078;
3044 _const_and_export SDLK_Y => 0x00000079;
3045 _const_and_export SDLK_Z => 0x0000007a;
3046 _const_and_export SDLK_LEFTBRACE => 0x0000007b;
3047 _const_and_export SDLK_PIPE => 0x0000007c;
3048 _const_and_export SDLK_RIGHTBRACE => 0x0000007d;
3049 _const_and_export SDLK_TILDE => 0x0000007e;
3050 _const_and_export SDLK_DELETE => 0x0000007f;
3051 _const_and_export SDLK_PLUSMINUS => 0x000000b1;
3052 _const_and_export SDLK_CAPSLOCK => 0x40000039;
3053 _const_and_export SDLK_F1 => 0x4000003a;
3054 _const_and_export SDLK_F2 => 0x4000003b;
3055 _const_and_export SDLK_F3 => 0x4000003c;
3056 _const_and_export SDLK_F4 => 0x4000003d;
3057 _const_and_export SDLK_F5 => 0x4000003e;
3058 _const_and_export SDLK_F6 => 0x4000003f;
3059 _const_and_export SDLK_F7 => 0x40000040;
3060 _const_and_export SDLK_F8 => 0x40000041;
3061 _const_and_export SDLK_F9 => 0x40000042;
3062 _const_and_export SDLK_F10 => 0x40000043;
3063 _const_and_export SDLK_F11 => 0x40000044;
3064 _const_and_export SDLK_F12 => 0x40000045;
3065 _const_and_export SDLK_PRINTSCREEN => 0x40000046;
3066 _const_and_export SDLK_SCROLLLOCK => 0x40000047;
3067 _const_and_export SDLK_PAUSE => 0x40000048;
3068 _const_and_export SDLK_INSERT => 0x40000049;
3069 _const_and_export SDLK_HOME => 0x4000004a;
3070 _const_and_export SDLK_PAGEUP => 0x4000004b;
3071 _const_and_export SDLK_END => 0x4000004d;
3072 _const_and_export SDLK_PAGEDOWN => 0x4000004e;
3073 _const_and_export SDLK_RIGHT => 0x4000004f;
3074 _const_and_export SDLK_LEFT => 0x40000050;
3075 _const_and_export SDLK_DOWN => 0x40000051;
3076 _const_and_export SDLK_UP => 0x40000052;
3077 _const_and_export SDLK_NUMLOCKCLEAR => 0x40000053;
3078 _const_and_export SDLK_KP_DIVIDE => 0x40000054;
3079 _const_and_export SDLK_KP_MULTIPLY => 0x40000055;
3080 _const_and_export SDLK_KP_MINUS => 0x40000056;
3081 _const_and_export SDLK_KP_PLUS => 0x40000057;
3082 _const_and_export SDLK_KP_ENTER => 0x40000058;
3083 _const_and_export SDLK_KP_1 => 0x40000059;
3084 _const_and_export SDLK_KP_2 => 0x4000005a;
3085 _const_and_export SDLK_KP_3 => 0x4000005b;
3086 _const_and_export SDLK_KP_4 => 0x4000005c;
3087 _const_and_export SDLK_KP_5 => 0x4000005d;
3088 _const_and_export SDLK_KP_6 => 0x4000005e;
3089 _const_and_export SDLK_KP_7 => 0x4000005f;
3090 _const_and_export SDLK_KP_8 => 0x40000060;
3091 _const_and_export SDLK_KP_9 => 0x40000061;
3092 _const_and_export SDLK_KP_0 => 0x40000062;
3093 _const_and_export SDLK_KP_PERIOD => 0x40000063;
3094 _const_and_export SDLK_APPLICATION => 0x40000065;
3095 _const_and_export SDLK_POWER => 0x40000066;
3096 _const_and_export SDLK_KP_EQUALS => 0x40000067;
3097 _const_and_export SDLK_F13 => 0x40000068;
3098 _const_and_export SDLK_F14 => 0x40000069;
3099 _const_and_export SDLK_F15 => 0x4000006a;
3100 _const_and_export SDLK_F16 => 0x4000006b;
3101 _const_and_export SDLK_F17 => 0x4000006c;
3102 _const_and_export SDLK_F18 => 0x4000006d;
3103 _const_and_export SDLK_F19 => 0x4000006e;
3104 _const_and_export SDLK_F20 => 0x4000006f;
3105 _const_and_export SDLK_F21 => 0x40000070;
3106 _const_and_export SDLK_F22 => 0x40000071;
3107 _const_and_export SDLK_F23 => 0x40000072;
3108 _const_and_export SDLK_F24 => 0x40000073;
3109 _const_and_export SDLK_EXECUTE => 0x40000074;
3110 _const_and_export SDLK_HELP => 0x40000075;
3111 _const_and_export SDLK_MENU => 0x40000076;
3112 _const_and_export SDLK_SELECT => 0x40000077;
3113 _const_and_export SDLK_STOP => 0x40000078;
3114 _const_and_export SDLK_AGAIN => 0x40000079;
3115 _const_and_export SDLK_UNDO => 0x4000007a;
3116 _const_and_export SDLK_CUT => 0x4000007b;
3117 _const_and_export SDLK_COPY => 0x4000007c;
3118 _const_and_export SDLK_PASTE => 0x4000007d;
3119 _const_and_export SDLK_FIND => 0x4000007e;
3120 _const_and_export SDLK_MUTE => 0x4000007f;
3121 _const_and_export SDLK_VOLUMEUP => 0x40000080;
3122 _const_and_export SDLK_VOLUMEDOWN => 0x40000081;
3123 _const_and_export SDLK_KP_COMMA => 0x40000085;
3124 _const_and_export SDLK_KP_EQUALSAS400 => 0x40000086;
3125 _const_and_export SDLK_ALTERASE => 0x40000099;
3126 _const_and_export SDLK_SYSREQ => 0x4000009a;
3127 _const_and_export SDLK_CANCEL => 0x4000009b;
3128 _const_and_export SDLK_CLEAR => 0x4000009c;
3129 _const_and_export SDLK_PRIOR => 0x4000009d;
3130 _const_and_export SDLK_RETURN2 => 0x4000009e;
3131 _const_and_export SDLK_SEPARATOR => 0x4000009f;
3132 _const_and_export SDLK_OUT => 0x400000a0;
3133 _const_and_export SDLK_OPER => 0x400000a1;
3134 _const_and_export SDLK_CLEARAGAIN => 0x400000a2;
3135 _const_and_export SDLK_CRSEL => 0x400000a3;
3136 _const_and_export SDLK_EXSEL => 0x400000a4;
3137 _const_and_export SDLK_KP_00 => 0x400000b0;
3138 _const_and_export SDLK_KP_000 => 0x400000b1;
3139 _const_and_export SDLK_THOUSANDSSEPARATOR => 0x400000b2;
3140 _const_and_export SDLK_DECIMALSEPARATOR => 0x400000b3;
3141 _const_and_export SDLK_CURRENCYUNIT => 0x400000b4;
3142 _const_and_export SDLK_CURRENCYSUBUNIT => 0x400000b5;
3143 _const_and_export SDLK_KP_LEFTPAREN => 0x400000b6;
3144 _const_and_export SDLK_KP_RIGHTPAREN => 0x400000b7;
3145 _const_and_export SDLK_KP_LEFTBRACE => 0x400000b8;
3146 _const_and_export SDLK_KP_RIGHTBRACE => 0x400000b9;
3147 _const_and_export SDLK_KP_TAB => 0x400000ba;
3148 _const_and_export SDLK_KP_BACKSPACE => 0x400000bb;
3149 _const_and_export SDLK_KP_A => 0x400000bc;
3150 _const_and_export SDLK_KP_B => 0x400000bd;
3151 _const_and_export SDLK_KP_C => 0x400000be;
3152 _const_and_export SDLK_KP_D => 0x400000bf;
3153 _const_and_export SDLK_KP_E => 0x400000c0;
3154 _const_and_export SDLK_KP_F => 0x400000c1;
3155 _const_and_export SDLK_KP_XOR => 0x400000c2;
3156 _const_and_export SDLK_KP_POWER => 0x400000c3;
3157 _const_and_export SDLK_KP_PERCENT => 0x400000c4;
3158 _const_and_export SDLK_KP_LESS => 0x400000c5;
3159 _const_and_export SDLK_KP_GREATER => 0x400000c6;
3160 _const_and_export SDLK_KP_AMPERSAND => 0x400000c7;
3161 _const_and_export SDLK_KP_DBLAMPERSAND => 0x400000c8;
3162 _const_and_export SDLK_KP_VERTICALBAR => 0x400000c9;
3163 _const_and_export SDLK_KP_DBLVERTICALBAR => 0x400000ca;
3164 _const_and_export SDLK_KP_COLON => 0x400000cb;
3165 _const_and_export SDLK_KP_HASH => 0x400000cc;
3166 _const_and_export SDLK_KP_SPACE => 0x400000cd;
3167 _const_and_export SDLK_KP_AT => 0x400000ce;
3168 _const_and_export SDLK_KP_EXCLAM => 0x400000cf;
3169 _const_and_export SDLK_KP_MEMSTORE => 0x400000d0;
3170 _const_and_export SDLK_KP_MEMRECALL => 0x400000d1;
3171 _const_and_export SDLK_KP_MEMCLEAR => 0x400000d2;
3172 _const_and_export SDLK_KP_MEMADD => 0x400000d3;
3173 _const_and_export SDLK_KP_MEMSUBTRACT => 0x400000d4;
3174 _const_and_export SDLK_KP_MEMMULTIPLY => 0x400000d5;
3175 _const_and_export SDLK_KP_MEMDIVIDE => 0x400000d6;
3176 _const_and_export SDLK_KP_PLUSMINUS => 0x400000d7;
3177 _const_and_export SDLK_KP_CLEAR => 0x400000d8;
3178 _const_and_export SDLK_KP_CLEARENTRY => 0x400000d9;
3179 _const_and_export SDLK_KP_BINARY => 0x400000da;
3180 _const_and_export SDLK_KP_OCTAL => 0x400000db;
3181 _const_and_export SDLK_KP_DECIMAL => 0x400000dc;
3182 _const_and_export SDLK_KP_HEXADECIMAL => 0x400000dd;
3183 _const_and_export SDLK_LCTRL => 0x400000e0;
3184 _const_and_export SDLK_LSHIFT => 0x400000e1;
3185 _const_and_export SDLK_LALT => 0x400000e2;
3186 _const_and_export SDLK_LGUI => 0x400000e3;
3187 _const_and_export SDLK_RCTRL => 0x400000e4;
3188 _const_and_export SDLK_RSHIFT => 0x400000e5;
3189 _const_and_export SDLK_RALT => 0x400000e6;
3190 _const_and_export SDLK_RGUI => 0x400000e7;
3191 _const_and_export SDLK_MODE => 0x40000101;
3192 _const_and_export SDLK_SLEEP => 0x40000102;
3193 _const_and_export SDLK_WAKE => 0x40000103;
3194 _const_and_export SDLK_CHANNEL_INCREMENT => 0x40000104;
3195 _const_and_export SDLK_CHANNEL_DECREMENT => 0x40000105;
3196 _const_and_export SDLK_MEDIA_PLAY => 0x40000106;
3197 _const_and_export SDLK_MEDIA_PAUSE => 0x40000107;
3198 _const_and_export SDLK_MEDIA_RECORD => 0x40000108;
3199 _const_and_export SDLK_MEDIA_FAST_FORWARD => 0x40000109;
3200 _const_and_export SDLK_MEDIA_REWIND => 0x4000010a;
3201 _const_and_export SDLK_MEDIA_NEXT_TRACK => 0x4000010b;
3202 _const_and_export SDLK_MEDIA_PREVIOUS_TRACK => 0x4000010c;
3203 _const_and_export SDLK_MEDIA_STOP => 0x4000010d;
3204 _const_and_export SDLK_MEDIA_EJECT => 0x4000010e;
3205 _const_and_export SDLK_MEDIA_PLAY_PAUSE => 0x4000010f;
3206 _const_and_export SDLK_MEDIA_SELECT => 0x40000110;
3207 _const_and_export SDLK_AC_NEW => 0x40000111;
3208 _const_and_export SDLK_AC_OPEN => 0x40000112;
3209 _const_and_export SDLK_AC_CLOSE => 0x40000113;
3210 _const_and_export SDLK_AC_EXIT => 0x40000114;
3211 _const_and_export SDLK_AC_SAVE => 0x40000115;
3212 _const_and_export SDLK_AC_PRINT => 0x40000116;
3213 _const_and_export SDLK_AC_PROPERTIES => 0x40000117;
3214 _const_and_export SDLK_AC_SEARCH => 0x40000118;
3215 _const_and_export SDLK_AC_HOME => 0x40000119;
3216 _const_and_export SDLK_AC_BACK => 0x4000011a;
3217 _const_and_export SDLK_AC_FORWARD => 0x4000011b;
3218 _const_and_export SDLK_AC_STOP => 0x4000011c;
3219 _const_and_export SDLK_AC_REFRESH => 0x4000011d;
3220 _const_and_export SDLK_AC_BOOKMARKS => 0x4000011e;
3221 _const_and_export SDLK_SOFTLEFT => 0x4000011f;
3222 _const_and_export SDLK_SOFTRIGHT => 0x40000120;
3223 _const_and_export SDLK_CALL => 0x40000121;
3224 _const_and_export SDLK_ENDCALL => 0x40000122;
3225 _const_and_export SDLK_LEFT_TAB => 0x20000001;
3226 _const_and_export SDLK_LEVEL5_SHIFT => 0x20000002;
3227 _const_and_export SDLK_MULTI_KEY_COMPOSE => 0x20000003;
3228 _const_and_export SDLK_LMETA => 0x20000004;
3229 _const_and_export SDLK_RMETA => 0x20000005;
3230 _const_and_export SDLK_LHYPER => 0x20000006;
3231 _const_and_export SDLK_RHYPER => 0x20000007;
3232 _typedef_and_export SDL_Keymod => UInt16;
3233 _const_and_export SDL_KMOD_NONE => 0x0000;
3234 _const_and_export SDL_KMOD_LSHIFT => 0x0001;
3235 _const_and_export SDL_KMOD_RSHIFT => 0x0002;
3236 _const_and_export SDL_KMOD_LEVEL5 => 0x0004;
3237 _const_and_export SDL_KMOD_LCTRL => 0x0040;
3238 _const_and_export SDL_KMOD_RCTRL => 0x0080;
3239 _const_and_export SDL_KMOD_LALT => 0x0100;
3240 _const_and_export SDL_KMOD_RALT => 0x0200;
3241 _const_and_export SDL_KMOD_LGUI => 0x0400;
3242 _const_and_export SDL_KMOD_RGUI => 0x0800;
3243 _const_and_export SDL_KMOD_NUM => 0x1000;
3244 _const_and_export SDL_KMOD_CAPS => 0x2000;
3245 _const_and_export SDL_KMOD_MODE => 0x4000;
3246 _const_and_export SDL_KMOD_SCROLL => 0x8000;
3247 _const_and_export SDL_KMOD_CTRL => ( 0x0040 | 0x0080 );
3248 _const_and_export SDL_KMOD_SHIFT => ( 0x0001 | 0x0002 );
3249 _const_and_export SDL_KMOD_ALT => ( 0x0100 | 0x0200 );
3250 _const_and_export SDL_KMOD_GUI => ( 0x0400 | 0x0800 );
3251 }
3252
3253 =head3 C<:loadso> - Shared Object/DLL Management
3254
3255 System-dependent library loading routines.
3256
3257 See L<SDL3: CategorySharedObject|https://wiki.libsdl.org/SDL3/CategorySharedObject>
3258
3259 =cut
3260
3261 sub _loadso() {
3262 state $done++ && return;
3263 #
3264 _error();
3265 _stdinc();
3266 #
3267 _typedef_and_export SDL_SharedObject => Void;
3268 #
3269 _affix_and_export SDL_LoadObject => [String], Pointer [ SDL_SharedObject() ];
3270 _affix_and_export SDL_LoadFunction => [ Pointer [ SDL_SharedObject() ], String ], Pointer [ SDL_FunctionPointer() ];
3271 _affix_and_export SDL_UnloadObject => [ Pointer [ SDL_SharedObject() ] ], Void;
3272 }
3273
3274 =head3 C<:locale> - Locale Info
3275
3276 A struct to provide locale data.
3277
3278 This provides a way to get a list of preferred locales (language plus country) for the user. There is exactly one
3279 function: L<SDL_GetPreferredLocales()|https://wiki.libsdl.org/SDL3/SDL_GetPreferredLocales>, which handles all the
3280 heavy lifting, and offers documentation on all the strange ways humans might have configured their language settings.
3281
3282 See L<SDL3: CategoryLocale|https://wiki.libsdl.org/SDL3/CategoryLocale>
3283
3284 =cut
3285
3286 sub _locale() {
3287 state $done++ && return;
3288 #
3289 _error();
3290 _stdinc();
3291 #
3292 _typedef_and_export SDL_Locale => Struct [ language => String, country => String ];
3293 _affix_and_export SDL_GetPreferredLocales => [ Pointer [Int] ], Pointer [ Pointer [ SDL_Locale() ] ];
3294 }
3295
3296 =head3 C<:log> - Log Handling
3297
3298 Simple log messages with priorities and categories. A message's C<SDL_LogPriority> signifies how important the message
3299 is. A message's C<SDL_LogCategory> signifies from what domain it belongs to. Every category has a minimum priority
3300 specified: when a message belongs to that category, it will only be sent out if it has that minimum priority or higher.
3301
3302 See L<SDL3: CategoryLog|https://wiki.libsdl.org/SDL3/CategoryLog>
3303
3304 =cut
3305
3306 sub _log() {
3307 state $done++ && return;
3308 #
3309 _stdinc();
3310 #
3311 _enum_and_export SDL_LogCategory => [
3312 'SDL_LOG_CATEGORY_APPLICATION', 'SDL_LOG_CATEGORY_ERROR', 'SDL_LOG_CATEGORY_ASSERT', 'SDL_LOG_CATEGORY_SYSTEM',
3313 'SDL_LOG_CATEGORY_AUDIO', 'SDL_LOG_CATEGORY_VIDEO', 'SDL_LOG_CATEGORY_RENDER', 'SDL_LOG_CATEGORY_INPUT',
3314 'SDL_LOG_CATEGORY_TEST', 'SDL_LOG_CATEGORY_GPU', 'SDL_LOG_CATEGORY_RESERVED2', 'SDL_LOG_CATEGORY_RESERVED3',
3315 'SDL_LOG_CATEGORY_RESERVED4', 'SDL_LOG_CATEGORY_RESERVED5', 'SDL_LOG_CATEGORY_RESERVED6', 'SDL_LOG_CATEGORY_RESERVED7',
3316 'SDL_LOG_CATEGORY_RESERVED8', 'SDL_LOG_CATEGORY_RESERVED9', 'SDL_LOG_CATEGORY_RESERVED10', 'SDL_LOG_CATEGORY_CUSTOM'
3317 ];
3318 _enum_and_export SDL_LogPriority => [
3319 'SDL_LOG_PRIORITY_INVALID', 'SDL_LOG_PRIORITY_TRACE', 'SDL_LOG_PRIORITY_VERBOSE', 'SDL_LOG_PRIORITY_DEBUG',
3320 'SDL_LOG_PRIORITY_INFO', 'SDL_LOG_PRIORITY_WARN', 'SDL_LOG_PRIORITY_ERROR', 'SDL_LOG_PRIORITY_CRITICAL',
3321 'SDL_LOG_PRIORITY_COUNT'
3322 ];
3323 #
3324 _typedef_and_export SDL_LogOutputFunction => Callback [ [ Pointer [Void], Int, SDL_LogPriority(), String ] => Void ];
3325 #
3326 _affix_and_export SDL_SetLogPriorities => [ SDL_LogPriority() ], Void;
3327 _affix_and_export SDL_SetLogPriority => [ Int, SDL_LogPriority() ], Void;
3328 _affix_and_export SDL_GetLogPriority => [Int], SDL_LogPriority();
3329 _affix_and_export SDL_ResetLogPriorities => [], Void;
3330 _affix_and_export SDL_SetLogPriorityPrefix => [ SDL_LogPriority(), String ], Bool;
3331 #
3332 _affix_and_export SDL_Log => [ String, VarArgs ], Void;
3333 _affix_and_export SDL_LogTrace => [ Int, String, VarArgs ], Void;
3334 _affix_and_export SDL_LogVerbose => [ Int, String, VarArgs ], Void;
3335 _affix_and_export SDL_LogDebug => [ Int, String, VarArgs ], Void;
3336 _affix_and_export SDL_LogInfo => [ Int, String, VarArgs ], Void;
3337 _affix_and_export SDL_LogWarn => [ Int, String, VarArgs ], Void;
3338 _affix_and_export SDL_LogError => [ Int, String, VarArgs ], Void;
3339 _affix_and_export SDL_LogCritical => [ Int, String, VarArgs ], Void;
3340 _affix_and_export SDL_LogMessage => [ Int, SDL_LogPriority(), String, VarArgs ], Void;
3341 _affix_and_export SDL_GetDefaultLogOutputFunction => [], SDL_LogOutputFunction();
3342 _affix_and_export SDL_GetLogOutputFunction => [ Pointer [ SDL_LogOutputFunction() ], Pointer [ Pointer [Void] ] ], Void;
3343 _affix_and_export SDL_SetLogOutputFunction => [ SDL_LogOutputFunction(), Pointer [Void] ], Void;
3344 }
3345
3346 =head3 C<:main> - Application entry points
3347
3348 This is a special import tag that informs SDL to use its new callback based App system.
3349
3350 You B<must> define L<SDL_AppInit|https://wiki.libsdl.org/SDL3/SDL_AppInit>,
3351 L<SDL_AppEvent|https://wiki.libsdl.org/SDL3/SDL_AppEvent>,
3352 L<SDL_AppIterate|https://wiki.libsdl.org/SDL3/SDL_AppIterate>, and
3353 L<SDL_AppQuit|https://wiki.libsdl.org/SDL3/SDL_AppQuit> in your code.
3354
3355 See F<eg/hello_world.pl> for an example and L<SDL3: CategoryMain|https://wiki.libsdl.org/SDL3/CategoryMain>.
3356
3357 =cut
3358
3359 sub _main() {
3360 state $done++ && return;
3361 #
3362 _error();
3363 _events();
3364 _platform_defines();
3365 _stdinc();
3366 #
3367 _typedef_and_export SDL_main_func => Callback [ [ Int, Pointer [String] ] => Int ];
3368 _affix_and_export SDL_SetMainReady => [], Void;
3369 _affix_and_export SDL_RunApp => [ Int, Pointer [String], SDL_main_func(), Pointer [Void] ], Int;
3370 _affix_and_export
3371 SDL_EnterAppMainCallbacks =>
3372 [ Int, Pointer [String], SDL_AppInit_func(), SDL_AppIterate_func(), SDL_AppEvent_func(), SDL_AppQuit_func() ],
3373 Int;
3374 if ( $^O eq 'MSWin32' ) {
3375 _affix_and_export SDL_RegisterApp => [ String, UInt32, Pointer [Void] ], Bool;
3376 _affix_and_export SDL_UnregisterApp => [], Void;
3377 _affix_and_export SDL_GDKSuspendComplete => [], Void;
3378 }
3379 }
3380
3381 =head3 C<:messagebox> - Message Boxes
3382
3383 SDL offers a simple message box API, which is useful for simple alerts, such as informing the user when something fatal
3384 happens at startup without the need to build a UI for it (or informing the user _before_ your UI is ready).
3385
3386 See L<SDL3: CategoryMessagebox|https://wiki.libsdl.org/SDL3/CategoryMessagebox>
3387
3388 =cut
3389
3390 sub _messagebox() {
3391 state $done++ && return;
3392 #
3393 _error();
3394 _stdinc();
3395 _video();
3396 #
3397 _typedef_and_export SDL_MessageBoxFlags => UInt32;
3398 _const_and_export SDL_MESSAGEBOX_ERROR => 0x00000010;
3399 _const_and_export SDL_MESSAGEBOX_WARNING => 0x00000020;
3400 _const_and_export SDL_MESSAGEBOX_INFORMATION => 0x00000040;
3401 _const_and_export SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT => 0x00000080;
3402 _const_and_export SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT => 0x00000100;
3403 _typedef_and_export SDL_MessageBoxButtonFlags => UInt32;
3404 _const_and_export SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT => 0x00000001;
3405 _const_and_export SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT => 0x00000002;
3406 _typedef_and_export SDL_MessageBoxButtonData => Struct [ flags => SDL_MessageBoxButtonFlags(), buttonID => Int, text => String ];
3407 _typedef_and_export SDL_MessageBoxColor => Struct [ r => UInt8, g => UInt8, b => UInt8 ];
3408 _enum_and_export SDL_MessageBoxColorType => [
3409 'SDL_MESSAGEBOX_COLOR_BACKGROUND', 'SDL_MESSAGEBOX_COLOR_TEXT',
3410 'SDL_MESSAGEBOX_COLOR_BUTTON_BORDER', 'SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND',
3411 'SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED', 'SDL_MESSAGEBOX_COLOR_COUNT'
3412 ];
3413 _typedef_and_export SDL_MessageBoxColorScheme => Struct [
3414 colors => Array [ SDL_MessageBoxColor(), 5 ] # SDL_MESSAGEBOX_COLOR_COUNT
3415 ];
3416 _typedef_and_export SDL_MessageBoxData => Struct [
3417 flags => SDL_MessageBoxFlags(),
3418 window => Pointer [ SDL_Window() ],
3419 title => String,
3420 message => String,
3421 numbuttons => Int,
3422 buttons => Pointer [ SDL_MessageBoxButtonData() ],
3423 colorScheme => Pointer [ SDL_MessageBoxColorScheme() ]
3424 ];
3425 _affix_and_export SDL_ShowMessageBox => [ Pointer [ SDL_MessageBoxData() ], Pointer [Int] ], Bool;
3426 _affix_and_export SDL_ShowSimpleMessageBox => [ SDL_MessageBoxFlags(), String, String, Pointer [ SDL_Window() ] ], Bool;
3427 }
3428
3429 =head3 C<:metal> - Metal support
3430
3431 Functions to creating Metal layers and views on SDL windows.
3432
3433 This provides some platform-specific glue for Apple platforms. Most macOS and iOS apps can use SDL without these
3434 functions, but this API they can be useful for specific OS-level integration tasks.
3435
3436 See L<SDL3: CategoryMetal|https://wiki.libsdl.org/SDL3/CategoryMetal>
3437
3438 =cut
3439
3440 sub _metal() { # Based on sdl-main/include/sdl3/sdl_metal.h
3441 state $done++ && return;
3442 _video();
3443 #
3444 _typedef_and_export SDL_MetalView => Pointer [Void];
3445 _affix_and_export SDL_Metal_CreateView => [ Pointer [ SDL_Window() ] ], SDL_MetalView();
3446 _affix_and_export SDL_Metal_DestroyView => [ SDL_MetalView() ], Void;
3447 _affix_and_export SDL_Metal_GetLayer => [ SDL_MetalView() ], Pointer [Void];
3448 }
3449
3450 =head3 C<:misc> - Miscellaneous
3451
3452 SDL API functions that don't fit elsewhere.
3453
3454 See L<SDL3: CategoryMisc|https://wiki.libsdl.org/SDL3/CategoryMisc>
3455
3456 =cut
3457
3458 sub _misc() { # Based on sdl-main/include/sdl3/sdl_misc.h
3459 state $done++ && return;
3460 _error();
3461 #
3462 _affix_and_export 'SDL_OpenURL', [String], Bool;
3463 }
3464
3465 =head3 C<:mouse> - Mouse Support
3466
3467 Any GUI application has to deal with the mouse, and SDL provides functions to manage mouse input and the displayed
3468 cursor.
3469
3470 See L<SDL3: CategoryMouse|https://wiki.libsdl.org/SDL3/CategoryMouse>
3471
3472 =cut
3473
3474 sub _mouse() {
3475 state $done++ && return;
3476 _error();
3477 _stdinc();
3478 _surface();
3479 _video();
3480 #
3481 _typedef_and_export SDL_MouseID => UInt32;
3482 _typedef_and_export SDL_Cursor => Void;
3483 _enum_and_export SDL_SystemCursor => [
3484 'SDL_SYSTEM_CURSOR_DEFAULT', 'SDL_SYSTEM_CURSOR_TEXT', 'SDL_SYSTEM_CURSOR_WAIT', 'SDL_SYSTEM_CURSOR_CROSSHAIR',
3485 'SDL_SYSTEM_CURSOR_PROGRESS', 'SDL_SYSTEM_CURSOR_NWSE_RESIZE', 'SDL_SYSTEM_CURSOR_NESW_RESIZE', 'SDL_SYSTEM_CURSOR_EW_RESIZE',
3486 'SDL_SYSTEM_CURSOR_NS_RESIZE', 'SDL_SYSTEM_CURSOR_MOVE', 'SDL_SYSTEM_CURSOR_NOT_ALLOWED', 'SDL_SYSTEM_CURSOR_POINTER',
3487 'SDL_SYSTEM_CURSOR_NW_RESIZE', 'SDL_SYSTEM_CURSOR_N_RESIZE', 'SDL_SYSTEM_CURSOR_NE_RESIZE', 'SDL_SYSTEM_CURSOR_E_RESIZE',
3488 'SDL_SYSTEM_CURSOR_SE_RESIZE', 'SDL_SYSTEM_CURSOR_S_RESIZE', 'SDL_SYSTEM_CURSOR_SW_RESIZE', 'SDL_SYSTEM_CURSOR_W_RESIZE',
3489 'SDL_SYSTEM_CURSOR_COUNT'
3490 ];
3491 _enum_and_export SDL_MouseWheelDirection => [ 'SDL_MOUSEWHEEL_NORMAL', 'SDL_MOUSEWHEEL_FLIPPED' ];
3492 _typedef_and_export SDL_CursorFrameInfo => Struct [ surface => Pointer [ SDL_Surface() ], duration => UInt32 ];
3493 _typedef_and_export SDL_MouseButtonFlags => UInt32;
3494 _const_and_export SDL_BUTTON_LEFT => 1;
3495 _const_and_export SDL_BUTTON_MIDDLE => 2;
3496 _const_and_export SDL_BUTTON_RIGHT => 3;
3497 _const_and_export SDL_BUTTON_X1 => 4;
3498 _const_and_export SDL_BUTTON_X2 => 5;
3499 _func_and_export SDL_BUTTON_MASK => sub ($X) { ( 1 << ( ($X) - 1 ) ) };
3500 _const_and_export SDL_BUTTON_LMASK => 1 << ( 1 - 1 );
3501 _const_and_export SDL_BUTTON_MMASK => 1 << ( 2 - 1 );
3502 _const_and_export SDL_BUTTON_RMASK => 1 << ( 3 - 1 );
3503 _const_and_export SDL_BUTTON_X1MASK => 1 << ( 4 - 1 );
3504 _const_and_export SDL_BUTTON_X2MASK => 1 << ( 5 - 1 );
3505 _typedef_and_export SDL_MouseMotionTransformCallback =>
3506 Callback [ [ Pointer [Void], UInt64, Pointer [ SDL_Window() ], SDL_MouseID(), Pointer [Float], Pointer [Float] ] => Void ];
3507 _affix_and_export SDL_HasMouse => [], Bool;
3508 _affix_and_export SDL_GetMice => [ Pointer [Int] ], Pointer [ SDL_MouseID() ];
3509 _affix_and_export SDL_GetMouseNameForID => [ SDL_MouseID() ], String;
3510 _affix_and_export SDL_GetMouseFocus => [], Pointer [ SDL_Window() ];
3511 _affix_and_export SDL_GetMouseState => [ Pointer [Float], Pointer [Float] ], SDL_MouseButtonFlags();
3512 _affix_and_export SDL_GetGlobalMouseState => [ Pointer [Float], Pointer [Float] ], SDL_MouseButtonFlags();
3513 _affix_and_export SDL_GetRelativeMouseState => [ Pointer [Float], Pointer [Float] ], SDL_MouseButtonFlags();
3514 _affix_and_export SDL_WarpMouseInWindow => [ Pointer [ SDL_Window() ], Float, Float ], Void;
3515 _affix_and_export SDL_WarpMouseGlobal => [ Float, Float ], Bool;
3516
3517 #~ _affix_and_export SDL_SetRelativeMouseTransform => [ SDL_MouseMotionTransformCallback(), Pointer [Void] ], Bool;
3518 _affix_and_export SDL_SetWindowRelativeMouseMode => [ Pointer [ SDL_Window() ], Bool ], Bool;
3519 _affix_and_export SDL_GetWindowRelativeMouseMode => [ Pointer [ SDL_Window() ] ], Bool;
3520 _affix_and_export SDL_CaptureMouse => [Bool], Bool;
3521 _affix_and_export SDL_CreateCursor => [ Pointer [UInt8], Pointer [UInt8], Int, Int, Int, Int ], Pointer [ SDL_Cursor() ];
3522 _affix_and_export SDL_CreateColorCursor => [ Pointer [ SDL_Surface() ], Int, Int ], Pointer [ SDL_Cursor() ];
3523
3524 #~ _affix_and_export
3525 #~ SDL_CreateAnimatedCursor => [ Pointer [ SDL_CursorFrameInfo() ], Int, Int, Int ],
3526 #~ Pointer [ SDL_Cursor() ];
3527 _affix_and_export SDL_CreateSystemCursor => [ SDL_SystemCursor() ], Pointer [ SDL_Cursor() ];
3528 _affix_and_export SDL_SetCursor => [ Pointer [ SDL_Cursor() ] ], Bool;
3529 _affix_and_export SDL_GetCursor => [], Pointer [ SDL_Cursor() ];
3530 _affix_and_export SDL_GetDefaultCursor => [], Pointer [ SDL_Cursor() ];
3531 _affix_and_export SDL_DestroyCursor => [ Pointer [ SDL_Cursor() ] ], Void;
3532 _affix_and_export SDL_ShowCursor => [], Bool;
3533 _affix_and_export SDL_HideCursor => [], Bool;
3534 _affix_and_export SDL_CursorVisible => [], Bool;
3535 }
3536
3537 =head3 C<:mutex> - Thread Synchronization Primitives
3538
3539 SDL offers several thread synchronization primitives. This document can't cover the complicated topic of thread safety,
3540 but reading up on what each of these primitives are, why they are useful, and how to correctly use them is vital to
3541 writing correct and safe multithreaded programs.
3542
3543 See L<SDL3: CategoryMutex|https://wiki.libsdl.org/SDL3/CategoryMutex>
3544
3545 =cut
3546
3547 sub _mutex() {
3548 state $done++ && return;
3549 #
3550 _atomic();
3551 _error();
3552 _stdinc();
3553 _thread();
3554 #
3555 _typedef_and_export SDL_Mutex => Void;
3556 _typedef_and_export SDL_RWLock => Void;
3557 _typedef_and_export SDL_Semaphore => Void;
3558 _typedef_and_export SDL_Condition => Void;
3559 _affix_and_export SDL_CreateMutex => [], Pointer [ SDL_Mutex() ];
3560 _affix_and_export SDL_LockMutex => [ Pointer [ SDL_Mutex() ] ], Void;
3561 _affix_and_export SDL_TryLockMutex => [ Pointer [ SDL_Mutex() ] ], Bool;
3562 _affix_and_export SDL_UnlockMutex => [ Pointer [ SDL_Mutex() ] ], Void;
3563 _affix_and_export SDL_DestroyMutex => [ Pointer [ SDL_Mutex() ] ], Void;
3564 _affix_and_export SDL_CreateRWLock => [], Pointer [ SDL_RWLock() ];
3565 _affix_and_export SDL_LockRWLockForReading => [ Pointer [ SDL_RWLock() ] ], Void;
3566 _affix_and_export SDL_LockRWLockForWriting => [ Pointer [ SDL_RWLock() ] ], Void;
3567 _affix_and_export SDL_TryLockRWLockForReading => [ Pointer [ SDL_RWLock() ] ], Bool;
3568 _affix_and_export SDL_TryLockRWLockForWriting => [ Pointer [ SDL_RWLock() ] ], Bool;
3569 _affix_and_export SDL_UnlockRWLock => [ Pointer [ SDL_RWLock() ] ], Void;
3570 _affix_and_export SDL_DestroyRWLock => [ Pointer [ SDL_RWLock() ] ], Void;
3571 _affix_and_export SDL_CreateSemaphore => [UInt32], Pointer [ SDL_Semaphore() ];
3572 _affix_and_export SDL_DestroySemaphore => [ Pointer [ SDL_Semaphore() ] ], Void;
3573 _affix_and_export SDL_WaitSemaphore => [ Pointer [ SDL_Semaphore() ] ], Void;
3574 _affix_and_export SDL_TryWaitSemaphore => [ Pointer [ SDL_Semaphore() ] ], Bool;
3575 _affix_and_export SDL_WaitSemaphoreTimeout => [ Pointer [ SDL_Semaphore() ], SInt32 ], Bool;
3576 _affix_and_export SDL_SignalSemaphore => [ Pointer [ SDL_Semaphore() ] ], Void;
3577 _affix_and_export SDL_GetSemaphoreValue => [ Pointer [ SDL_Semaphore() ] ], UInt32;
3578 _affix_and_export SDL_CreateCondition => [], Pointer [ SDL_Condition() ];
3579 _affix_and_export SDL_DestroyCondition => [ Pointer [ SDL_Condition() ] ], Void;
3580 _affix_and_export SDL_SignalCondition => [ Pointer [ SDL_Condition() ] ], Void;
3581 _affix_and_export SDL_BroadcastCondition => [ Pointer [ SDL_Condition() ] ], Void;
3582 _affix_and_export SDL_WaitCondition => [ Pointer [ SDL_Condition() ], Pointer [ SDL_Mutex() ] ], Void;
3583 _affix_and_export SDL_WaitConditionTimeout => [ Pointer [ SDL_Condition() ], Pointer [ SDL_Mutex() ], SInt32 ], Bool;
3584 _enum_and_export SDL_InitStatus =>
3585 [ 'SDL_INIT_STATUS_UNINITIALIZED', 'SDL_INIT_STATUS_INITIALIZING', 'SDL_INIT_STATUS_INITIALIZED', 'SDL_INIT_STATUS_UNINITIALIZING' ];
3586 _typedef_and_export SDL_InitState => Struct [ status => SDL_AtomicInt(), thread => SDL_ThreadID(), reserved => Pointer [Void] ];
3587 _affix_and_export SDL_ShouldInit => [ Pointer [ SDL_InitState() ] ], Bool;
3588 _affix_and_export SDL_ShouldQuit => [ Pointer [ SDL_InitState() ] ], Bool;
3589 _affix_and_export SDL_SetInitialized => [ Pointer [ SDL_InitState() ], Bool ], Void;
3590 }
3591
3592 # This is on my TODO list...
3593 sub _opengl() {
3594 state $done++ && return;
3595 _platform();
3596 }
3597
3598 =head3 C<:pen> - Pen Support
3599
3600 SDL pen event handling.
3601
3602 SDL provides an API for pressure-sensitive pen (stylus and/or eraser) handling, e.g., for input and drawing tablets or
3603 suitably equipped mobile / tablet devices.
3604
3605 See L<SDL3: CategoryPen|https://wiki.libsdl.org/SDL3/CategoryPen>
3606
3607 =cut
3608
3609 sub _pen() {
3610 state $done++ && return;
3611 #
3612 _mouse();
3613 _stdinc();
3614 _touch();
3615 #
3616 _typedef_and_export SDL_PenID => UInt32;
3617 _const_and_export SDL_PEN_MOUSEID => -2;
3618 _const_and_export SDL_PEN_TOUCHID => -2;
3619 _typedef_and_export SDL_PenInputFlags => UInt32;
3620 _const_and_export SDL_PEN_INPUT_DOWN => ( 1 << 0 );
3621 _const_and_export SDL_PEN_INPUT_BUTTON_1 => ( 1 << 1 );
3622 _const_and_export SDL_PEN_INPUT_BUTTON_2 => ( 1 << 2 );
3623 _const_and_export SDL_PEN_INPUT_BUTTON_3 => ( 1 << 3 );
3624 _const_and_export SDL_PEN_INPUT_BUTTON_4 => ( 1 << 4 );
3625 _const_and_export SDL_PEN_INPUT_BUTTON_5 => ( 1 << 5 );
3626 _const_and_export SDL_PEN_INPUT_ERASER_TIP => ( 1 << 30 );
3627 _const_and_export SDL_PEN_INPUT_IN_PROXIMITY => ( 1 << 31 );
3628 _enum_and_export SDL_PenAxis => [
3629 'SDL_PEN_AXIS_PRESSURE', 'SDL_PEN_AXIS_XTILT', 'SDL_PEN_AXIS_YTILT', 'SDL_PEN_AXIS_DISTANCE',
3630 'SDL_PEN_AXIS_ROTATION', 'SDL_PEN_AXIS_SLIDER', 'SDL_PEN_AXIS_TANGENTIAL_PRESSURE', 'SDL_PEN_AXIS_COUNT'
3631 ];
3632 _enum_and_export SDL_PenDeviceType =>
3633 [ [ SDL_PEN_DEVICE_TYPE_INVALID => -1 ], 'SDL_PEN_DEVICE_TYPE_UNKNOWN', 'SDL_PEN_DEVICE_TYPE_DIRECT', 'SDL_PEN_DEVICE_TYPE_INDIRECT' ];
3634
3635 #~ _affix_and_export SDL_GetPenDeviceType => [ SDL_PenID() ], SDL_PenDeviceType();
3636 }
3637
3638 =head3 C<:pixels> - Pixel Formats and Conversion Routines
3639
3640 SDL offers facilities for pixel management.
3641
3642 See L<SDL3: CategoryPixels|https://wiki.libsdl.org/SDL3/CategoryPixels>
3643
3644 =cut
3645
3646 sub _pixels() {
3647 state $done++ && return;
3648 _error();
3649 _stdinc();
3650 #
3651 _const_and_export SDL_ALPHA_OPAQUE => 255;
3652 _const_and_export SDL_ALPHA_OPAQUE_FLOAT => 1.0;
3653 _const_and_export SDL_ALPHA_TRANSPARENT => 0;
3654 _const_and_export SDL_ALPHA_TRANSPARENT_FLOAT => 0.0;
3655 _enum_and_export SDL_PixelType => [
3656 [ SDL_PIXELTYPE_UNKNOWN => 0 ],
3657 [ SDL_PIXELTYPE_INDEX1 => 1 ],
3658 [ SDL_PIXELTYPE_INDEX4 => 2 ],
3659 [ SDL_PIXELTYPE_INDEX8 => 3 ],
3660 [ SDL_PIXELTYPE_PACKED8 => 4 ],
3661 [ SDL_PIXELTYPE_PACKED16 => 5 ],
3662 [ SDL_PIXELTYPE_PACKED32 => 6 ],
3663 [ SDL_PIXELTYPE_ARRAYU8 => 7 ],
3664 [ SDL_PIXELTYPE_ARRAYU16 => 8 ],
3665 [ SDL_PIXELTYPE_ARRAYU32 => 9 ],
3666 [ SDL_PIXELTYPE_ARRAYF16 => 10 ],
3667 [ SDL_PIXELTYPE_ARRAYF32 => 11 ],
3668 [ SDL_PIXELTYPE_INDEX2 => 12 ],
3669 ];
3670 _enum_and_export SDL_BitmapOrder => [qw[SDL_BITMAPORDER_NONE SDL_BITMAPORDER_4321 SDL_BITMAPORDER_1234]];
3671 _enum_and_export SDL_PackedOrder => [
3672 qw[SDL_PACKEDORDER_NONE
3673 SDL_PACKEDORDER_XRGB SDL_PACKEDORDER_RGBX SDL_PACKEDORDER_ARGB SDL_PACKEDORDER_RGBA
3674 SDL_PACKEDORDER_XBGR SDL_PACKEDORDER_BGRX SDL_PACKEDORDER_ABGR SDL_PACKEDORDER_BGRA]
3675 ];
3676 _enum_and_export SDL_ArrayOrder => [
3677 qw[
3678 SDL_ARRAYORDER_NONE SDL_ARRAYORDER_RGB SDL_ARRAYORDER_RGBA SDL_ARRAYORDER_ARGB
3679 SDL_ARRAYORDER_BGR SDL_ARRAYORDER_BGRA SDL_ARRAYORDER_ABGR]
3680 ];
3681 _enum_and_export SDL_PackedLayout => [
3682 qw[
3683 SDL_PACKEDLAYOUT_NONE
3684 SDL_PACKEDLAYOUT_332 SDL_PACKEDLAYOUT_4444 SDL_PACKEDLAYOUT_1555
3685 SDL_PACKEDLAYOUT_5551 SDL_PACKEDLAYOUT_565 SDL_PACKEDLAYOUT_8888
3686 SDL_PACKEDLAYOUT_2101010 SDL_PACKEDLAYOUT_1010102
3687 ]
3688 ];
3689 _func_and_export( SDL_DEFINE_PIXELFOURCC => sub ( $A, $B, $C, $D ) { SDL_FOURCC( $A, $B, $C, $D ) } );
3690 _func_and_export(
3691 SDL_DEFINE_PIXELFORMAT => sub ( $type, $order, $layout, $bits, $bytes ) {
3692 ( ( 1 << 28 ) | ( ($type) << 24 ) | ( ($order) << 20 ) | ( ($layout) << 16 ) | ( ($bits) << 8 ) | ( ($bytes) << 0 ) )
3693 }
3694 );
3695 _func_and_export( SDL_PIXELFLAG => sub ($format) { ( ( ($format) >> 28 ) & 0x0F ) } );
3696 _func_and_export( SDL_PIXELTYPE => sub ($format) { ( ( ($format) >> 24 ) & 0x0F ) } );
3697 _func_and_export( SDL_PIXELORDER => sub ($format) { ( ( ($format) >> 20 ) & 0x0F ) } );
3698 _func_and_export( SDL_PIXELLAYOUT => sub ($format) { ( ( ($format) >> 16 ) & 0x0F ) } );
3699 _func_and_export( SDL_BITSPERPIXEL => sub ($format) { ( SDL_ISPIXELFORMAT_FOURCC($format) ? 0 : ( ( ($format) >> 8 ) & 0xFF ) ) } );
3700 _func_and_export(
3701 SDL_BYTESPERPIXEL => sub ($format) {
3702 (
3703 SDL_ISPIXELFORMAT_FOURCC($format) ?
3704 (
3705 (
3706 ( ($format) == SDL_PIXELFORMAT_YUY2() ) ||
3707 ( ($format) == SDL_PIXELFORMAT_UYVY() ) ||
3708 ( ($format) == SDL_PIXELFORMAT_YVYU() ) ||
3709 ( ($format) == SDL_PIXELFORMAT_P010() )
3710 ) ? 2 : 1
3711 ) :
3712 ( ( ($format) >> 0 ) & 0xFF )
3713 )
3714 }
3715 );
3716 _func_and_export(
3717 SDL_ISPIXELFORMAT_INDEXED => sub ($format) {
3718 (
3719 !SDL_ISPIXELFORMAT_FOURCC($format) &&
3720 ( ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_INDEX1() ) ||
3721 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_INDEX2() ) ||
3722 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_INDEX4() ) ||
3723 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_INDEX8() ) )
3724 )
3725 }
3726 );
3727 _func_and_export(
3728 SDL_ISPIXELFORMAT_PACKED => sub ($format) {
3729 (
3730 !SDL_ISPIXELFORMAT_FOURCC($format) &&
3731 ( ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_PACKED8() ) ||
3732 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_PACKED16() ) ||
3733 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_PACKED32() ) )
3734 )
3735 }
3736 );
3737 _func_and_export(
3738 SDL_ISPIXELFORMAT_ARRAY => sub ($format) {
3739 (
3740 !SDL_ISPIXELFORMAT_FOURCC($format) &&
3741 ( ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_ARRAYU8() ) ||
3742 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_ARRAYU16() ) ||
3743 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_ARRAYU32() ) ||
3744 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_ARRAYF16() ) ||
3745 ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_ARRAYF32() ) )
3746 )
3747 }
3748 );
3749 _func_and_export(
3750 SDL_ISPIXELFORMAT_10BIT => sub ($format) {
3751 ( !SDL_ISPIXELFORMAT_FOURCC($format) &&
3752 ( ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_PACKED32() ) && ( SDL_PIXELLAYOUT($format) == SDL_PACKEDLAYOUT_2101010() ) ) )
3753 }
3754 );
3755 _func_and_export(
3756 SDL_ISPIXELFORMAT_FLOAT => sub ($format) {
3757 ( !SDL_ISPIXELFORMAT_FOURCC($format) &&
3758 ( ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_ARRAYF16() ) || ( SDL_PIXELTYPE($format) == SDL_PIXELTYPE_ARRAYF32() ) ) )
3759 }
3760 );
3761 _func_and_export(
3762 SDL_ISPIXELFORMAT_ALPHA => sub ($format) {
3763 (
3764 (
3765 SDL_ISPIXELFORMAT_PACKED($format) &&
3766 ( ( SDL_PIXELORDER($format) == SDL_PACKEDORDER_ARGB() ) ||
3767 ( SDL_PIXELORDER($format) == SDL_PACKEDORDER_RGBA() ) ||
3768 ( SDL_PIXELORDER($format) == SDL_PACKEDORDER_ABGR() ) ||
3769 ( SDL_PIXELORDER($format) == SDL_PACKEDORDER_BGRA() ) )
3770 ) ||
3771 (
3772 SDL_ISPIXELFORMAT_ARRAY($format) &&
3773 ( ( SDL_PIXELORDER($format) == SDL_ARRAYORDER_ARGB() ) ||
3774 ( SDL_PIXELORDER($format) == SDL_ARRAYORDER_RGBA() ) ||
3775 ( SDL_PIXELORDER($format) == SDL_ARRAYORDER_ABGR() ) ||
3776 ( SDL_PIXELORDER($format) == SDL_ARRAYORDER_BGRA() ) )
3777 )
3778 )
3779 }
3780 );
3781 _func_and_export( SDL_ISPIXELFORMAT_FOURCC => sub ($format) { ( ($format) && ( SDL_PIXELFLAG($format) != 1 ) ) } );
3782 _enum_and_export SDL_PixelFormat => [
3783 [ SDL_PIXELFORMAT_UNKNOWN => 0 ], [ SDL_PIXELFORMAT_INDEX1LSB => 0x11100100 ], [ SDL_PIXELFORMAT_INDEX1MSB => 0x11200100 ],
3784 [ SDL_PIXELFORMAT_INDEX2LSB => 0x1c100200 ], [ SDL_PIXELFORMAT_INDEX2MSB => 0x1c200200 ], [ SDL_PIXELFORMAT_INDEX4LSB => 0x12100400 ],
3785 [ SDL_PIXELFORMAT_INDEX4MSB => 0x12200400 ], [ SDL_PIXELFORMAT_INDEX8 => 0x13000801 ], [ SDL_PIXELFORMAT_RGB332 => 0x14110801 ],
3786 [ SDL_PIXELFORMAT_XRGB4444 => 0x15120c02 ], [ SDL_PIXELFORMAT_XBGR4444 => 0x15520c02 ], [ SDL_PIXELFORMAT_XRGB1555 => 0x15130f02 ],
3787 [ SDL_PIXELFORMAT_XBGR1555 => 0x15530f02 ], [ SDL_PIXELFORMAT_ARGB4444 => 0x15321002 ], [ SDL_PIXELFORMAT_RGBA4444 => 0x15421002 ],
3788 [ SDL_PIXELFORMAT_ABGR4444 => 0x15721002 ], [ SDL_PIXELFORMAT_BGRA4444 => 0x15821002 ], [ SDL_PIXELFORMAT_ARGB1555 => 0x15331002 ],
3789 [ SDL_PIXELFORMAT_RGBA5551 => 0x15441002 ], [ SDL_PIXELFORMAT_ABGR1555 => 0x15731002 ], [ SDL_PIXELFORMAT_BGRA5551 => 0x15841002 ],
3790 [ SDL_PIXELFORMAT_RGB565 => 0x15151002 ], [ SDL_PIXELFORMAT_BGR565 => 0x15551002 ], [ SDL_PIXELFORMAT_RGB24 => 0x17101803 ],
3791 [ SDL_PIXELFORMAT_BGR24 => 0x17401803 ], [ SDL_PIXELFORMAT_XRGB8888 => 0x16161804 ], [ SDL_PIXELFORMAT_RGBX8888 => 0x16261804 ],
3792 [ SDL_PIXELFORMAT_XBGR8888 => 0x16561804 ], [ SDL_PIXELFORMAT_BGRX8888 => 0x16661804 ], [ SDL_PIXELFORMAT_ARGB8888 => 0x16362004 ],
3793 [ SDL_PIXELFORMAT_RGBA8888 => 0x16462004 ], [ SDL_PIXELFORMAT_ABGR8888 => 0x16762004 ], [ SDL_PIXELFORMAT_BGRA8888 => 0x16862004 ],
3794 [ SDL_PIXELFORMAT_XRGB2101010 => 0x16172004 ], [ SDL_PIXELFORMAT_XBGR2101010 => 0x16572004 ],
3795 [ SDL_PIXELFORMAT_ARGB2101010 => 0x16372004 ], [ SDL_PIXELFORMAT_ABGR2101010 => 0x16772004 ], [ SDL_PIXELFORMAT_RGB48 => 0x18103006 ],
3796 [ SDL_PIXELFORMAT_BGR48 => 0x18403006 ], [ SDL_PIXELFORMAT_RGBA64 => 0x18204008 ], [ SDL_PIXELFORMAT_ARGB64 => 0x18304008 ],
3797 [ SDL_PIXELFORMAT_BGRA64 => 0x18504008 ], [ SDL_PIXELFORMAT_ABGR64 => 0x18604008 ], [ SDL_PIXELFORMAT_RGB48_FLOAT => 0x1a103006 ],
3798 [ SDL_PIXELFORMAT_BGR48_FLOAT => 0x1a403006 ], [ SDL_PIXELFORMAT_RGBA64_FLOAT => 0x1a204008 ],
3799 [ SDL_PIXELFORMAT_ARGB64_FLOAT => 0x1a304008 ], [ SDL_PIXELFORMAT_BGRA64_FLOAT => 0x1a504008 ],
3800 [ SDL_PIXELFORMAT_ABGR64_FLOAT => 0x1a604008 ], [ SDL_PIXELFORMAT_RGB96_FLOAT => 0x1b10600c ],
3801 [ SDL_PIXELFORMAT_BGR96_FLOAT => 0x1b40600c ], [ SDL_PIXELFORMAT_RGBA128_FLOAT => 0x1b208010 ],
3802 [ SDL_PIXELFORMAT_ARGB128_FLOAT => 0x1b308010 ], [ SDL_PIXELFORMAT_BGRA128_FLOAT => 0x1b508010 ],
3803 [ SDL_PIXELFORMAT_ABGR128_FLOAT => 0x1b608010 ], [ SDL_PIXELFORMAT_YV12 => 0x32315659 ], [ SDL_PIXELFORMAT_IYUV => 0x56555949 ],
3804 [ SDL_PIXELFORMAT_YUY2 => 0x32595559 ], [ SDL_PIXELFORMAT_UYVY => 0x59565955 ], [ SDL_PIXELFORMAT_YVYU => 0x55595659 ],
3805 [ SDL_PIXELFORMAT_NV12 => 0x3231564e ], [ SDL_PIXELFORMAT_NV21 => 0x3132564e ], [ SDL_PIXELFORMAT_P010 => 0x30313050 ],
3806 [ SDL_PIXELFORMAT_EXTERNAL_OES => 0x2053454f ], [ SDL_PIXELFORMAT_MJPG => 0x47504a4d ],
3807
3808 # Aliases for RGBA byte arrays of color data, for the current platform
3809 (
3810 $Config{byteorder} =~ /1$/ ?
3811 (
3812 [ SDL_PIXELFORMAT_RGBA32 => 'SDL_PIXELFORMAT_RGBA8888' ],
3813 [ SDL_PIXELFORMAT_ARGB32 => 'SDL_PIXELFORMAT_ARGB8888' ],
3814 [ SDL_PIXELFORMAT_BGRA32 => 'SDL_PIXELFORMAT_BGRA8888' ],
3815 [ SDL_PIXELFORMAT_ABGR32 => 'SDL_PIXELFORMAT_ABGR8888' ],
3816 [ SDL_PIXELFORMAT_RGBX32 => 'SDL_PIXELFORMAT_RGBX8888' ],
3817 [ SDL_PIXELFORMAT_XRGB32 => 'SDL_PIXELFORMAT_XRGB8888' ],
3818 [ SDL_PIXELFORMAT_BGRX32 => 'SDL_PIXELFORMAT_BGRX8888' ],
3819 [ SDL_PIXELFORMAT_XBGR32 => 'SDL_PIXELFORMAT_XBGR8888' ]
3820 ) :
3821 (
3822 [ SDL_PIXELFORMAT_RGBA32 => 'SDL_PIXELFORMAT_ABGR8888' ],
3823 [ SDL_PIXELFORMAT_ARGB32 => 'SDL_PIXELFORMAT_BGRA8888' ],
3824 [ SDL_PIXELFORMAT_BGRA32 => 'SDL_PIXELFORMAT_ARGB8888' ],
3825 [ SDL_PIXELFORMAT_ABGR32 => 'SDL_PIXELFORMAT_RGBA8888' ],
3826 [ SDL_PIXELFORMAT_RGBX32 => 'SDL_PIXELFORMAT_XBGR8888' ],
3827 [ SDL_PIXELFORMAT_XRGB32 => 'SDL_PIXELFORMAT_BGRX8888' ],
3828 [ SDL_PIXELFORMAT_BGRX32 => 'SDL_PIXELFORMAT_XRGB8888' ],
3829 [ SDL_PIXELFORMAT_XBGR32 => 'SDL_PIXELFORMAT_RGBX8888' ]
3830 )
3831 )
3832 ];
3833 _func_and_export(
3834 SDL_DEFINE_COLORSPACE => sub ( $type, $range, $primaries, $transfer, $matrix, $chroma ) {
3835 ( ( ($type) << 28 ) | ( ($range) << 24 ) | ( ($chroma) << 20 ) | ( ($primaries) << 10 ) | ( ($transfer) << 5 ) | ( ($matrix) << 0 ) )
3836 }
3837 );
3838 _func_and_export( SDL_COLORSPACETYPE => sub ($cspace) { ( ( ($cspace) >> 28 ) & 0x0F ) } );
3839 _func_and_export( SDL_COLORSPACERANGE => sub ($cspace) { ( ( ($cspace) >> 24 ) & 0x0F ) } );
3840 _func_and_export( SDL_COLORSPACECHROMA => sub ($cspace) { ( ( ($cspace) >> 20 ) & 0x0F ) } );
3841 _func_and_export( SDL_COLORSPACEPRIMARIES => sub ($cspace) { ( ( ($cspace) >> 10 ) & 0x1F ) } );
3842 _func_and_export( SDL_COLORSPACETRANSFER => sub ($cspace) { ( ( ($cspace) >> 5 ) & 0x1F ) } );
3843 _func_and_export( SDL_COLORSPACEMATRIX => sub ($cspace) { ( ($cspace) & 0x1F ) } );
3844 _func_and_export(
3845 SDL_ISCOLORSPACE_MATRIX_BT601 => sub ($cspace) {
3846 ( SDL_COLORSPACEMATRIX($cspace) == SDL_MATRIX_COEFFICIENTS_BT601() ||
3847 SDL_COLORSPACEMATRIX($cspace) == SDL_MATRIX_COEFFICIENTS_BT470BG() )
3848 }
3849 );
3850 _func_and_export( SDL_ISCOLORSPACE_MATRIX_BT709 => sub ($cspace) { ( SDL_COLORSPACEMATRIX($cspace) == SDL_MATRIX_COEFFICIENTS_BT709() ) } );
3851 _func_and_export(
3852 SDL_ISCOLORSPACE_MATRIX_BT2020_NCL => sub ($cspace) { ( SDL_COLORSPACEMATRIX($cspace) == SDL_MATRIX_COEFFICIENTS_BT2020_NCL() ) } );
3853 _func_and_export( SDL_ISCOLORSPACE_LIMITED_RANGE => sub ($cspace) { ( SDL_COLORSPACERANGE($cspace) != SDL_COLOR_RANGE_FULL() ) } );
3854 _func_and_export( SDL_ISCOLORSPACE_FULL_RANGE => sub ($cspace) { ( SDL_COLORSPACERANGE($cspace) == SDL_COLOR_RANGE_FULL() ) } );
3855 _enum_and_export SDL_Colorspace => [
3856 [ SDL_COLORSPACE_UNKNOWN => 0 ],
3857 [ SDL_COLORSPACE_SRGB => 0x120005a0 ],
3858 [ SDL_COLORSPACE_SRGB_LINEAR => 0x12000500 ],
3859 [ SDL_COLORSPACE_HDR10 => 0x12002600 ],
3860 [ SDL_COLORSPACE_JPEG => 0x220004c6 ],
3861 [ SDL_COLORSPACE_BT601_LIMITED => 0x211018c6 ],
3862 [ SDL_COLORSPACE_BT601_FULL => 0x221018c6 ],
3863 [ SDL_COLORSPACE_BT709_LIMITED => 0x21100421 ],
3864 [ SDL_COLORSPACE_BT709_FULL => 0x22100421 ],
3865 [ SDL_COLORSPACE_BT2020_LIMITED => 0x21102609 ],
3866 [ SDL_COLORSPACE_BT2020_FULL => 0x22102609 ],
3867 [ SDL_COLORSPACE_RGB_DEFAULT => 'SDL_COLORSPACE_SRGB' ],
3868 [ SDL_COLORSPACE_YUV_DEFAULT => 'SDL_COLORSPACE_BT601_LIMITED' ]
3869 ];
3870 _typedef_and_export SDL_Color => Struct [ r => UInt8, g => UInt8, b => UInt8, a => UInt8 ];
3871 _typedef_and_export SDL_FColor => Struct [ r => Float, g => Float, b => Float, a => Float ];
3872 _typedef_and_export SDL_Palette => Struct [ ncolors => Int, colors => Pointer [ SDL_Color() ], version => UInt32, refcount => Int ];
3873 _typedef_and_export SDL_PixelFormatDetails => Struct [
3874 format => SDL_PixelFormat(),
3875 bits_per_pixel => UInt8,
3876 bytes_per_pixel => UInt8,
3877 padding => Array [ UInt8, 2 ],
3878 Rmask => UInt32,
3879 Gmask => UInt32,
3880 Bmask => UInt32,
3881 Amask => UInt32,
3882 Rbits => UInt8,
3883 Gbits => UInt8,
3884 Bbits => UInt8,
3885 Abits => UInt8,
3886 Rshift => UInt8,
3887 Gshift => UInt8,
3888 Bshift => UInt8,
3889 Ashift => UInt8
3890 ];
3891 _affix_and_export SDL_GetPixelFormatName => [ SDL_PixelFormat() ], String;
3892 _affix_and_export
3893 SDL_GetMasksForPixelFormat =>
3894 [ SDL_PixelFormat(), Pointer [Int], Pointer [UInt32], Pointer [UInt32], Pointer [UInt32], Pointer [UInt32] ],
3895 Bool;
3896 _affix_and_export SDL_GetPixelFormatForMasks => [ Int, UInt32, UInt32, UInt32, UInt32 ], SDL_PixelFormat();
3897 _affix_and_export SDL_GetPixelFormatDetails => [ SDL_PixelFormat() ], Pointer [ SDL_PixelFormatDetails() ];
3898 _affix_and_export SDL_CreatePalette => [Int], Pointer [ SDL_Palette() ];
3899 _affix_and_export SDL_SetPaletteColors => [ Pointer [ SDL_Palette() ], Pointer [ SDL_Color() ], Int, Int ], Bool;
3900 _affix_and_export SDL_DestroyPalette => [ Pointer [ SDL_Palette() ] ], Void;
3901 _affix_and_export SDL_MapRGB => [ Pointer [ SDL_PixelFormatDetails() ], Pointer [ SDL_Palette() ], UInt8, UInt8, UInt8 ], UInt32;
3902 _affix_and_export
3903 SDL_MapRGBA => [ Pointer [ SDL_PixelFormatDetails() ], Pointer [ SDL_Palette() ], UInt8, UInt8, UInt8, UInt8 ],
3904 UInt32;
3905 _affix_and_export
3906 SDL_GetRGB =>
3907 [ UInt32, Pointer [ SDL_PixelFormatDetails() ], Pointer [ SDL_Palette() ], Pointer [UInt8], Pointer [UInt8], Pointer [UInt8] ],
3908 Void;
3909 _affix_and_export
3910 SDL_GetRGBA => [
3911 UInt32,
3912 Pointer [ SDL_PixelFormatDetails() ],
3913 Pointer [ SDL_Palette() ],
3914 Pointer [UInt8],
3915 Pointer [UInt8],
3916 Pointer [UInt8],
3917 Pointer [UInt8]
3918 ],
3919 Void;
3920 }
3921
3922 =head3 C<:platform> - Platform Detection
3923
3924 SDL provides a means to identify the app's platform, both at compile time and runtime.
3925
3926 See L<SDL3: CategoryPlatform|https://wiki.libsdl.org/SDL3/CategoryPlatform>
3927
3928 =cut
3929
3930 sub _platform() {
3931 state $done++ && return;
3932 _platform_defines();
3933 #
3934 _affix_and_export 'SDL_GetPlatform', [], String;
3935 }
3936
3937 sub _platform_defines() {
3938 state $done++ && return;
3939
3940 # We don't need this
3941 }
3942
3943 =head3 C<:power> - Power Management Status
3944
3945 SDL power management routines.
3946
3947 Well, routine.
3948
3949 There is a single function in this category: L<SDL_GetPowerInfo()|https://wiki.libsdl.org/SDL3/SDL_GetPowerInfo>.
3950
3951 This function is useful for games on the go. This allows an app to know if it's running on a draining battery, which
3952 can be useful if the app wants to reduce processing, or perhaps framerate, to extend the duration of the battery's
3953 charge. Perhaps the app just wants to show a battery meter when fullscreen, or alert the user when the power is getting
3954 extremely low, so they can save their game.
3955
3956 See L<SDL3: CategoryPower|https://wiki.libsdl.org/SDL3/CategoryPower>
3957
3958 =cut
3959
3960 sub _power() {
3961 state $done++ && return;
3962 #
3963 _error();
3964 _stdinc();
3965 #
3966 _enum_and_export SDL_PowerState => [
3967 [ SDL_POWERSTATE_ERROR => -1 ],
3968 [ SDL_POWERSTATE_UNKNOWN => 0 ],
3969 [ SDL_POWERSTATE_ON_BATTERY => 1 ],
3970 [ SDL_POWERSTATE_NO_BATTERY => 2 ],
3971 [ SDL_POWERSTATE_CHARGING => 3 ],
3972 [ SDL_POWERSTATE_CHARGED => 4 ],
3973 ];
3974 _affix_and_export SDL_GetPowerInfo => [ Pointer [Int], Pointer [Int] ], SDL_PowerState();
3975 }
3976
3977 =head3 C<:process> - Process Control
3978
3979 Process control support.
3980
3981 These functions provide a cross-platform way to spawn and manage OS-level processes.
3982
3983 See L<SDL3: CategoryProcess|https://wiki.libsdl.org/SDL3/CategoryProcess>
3984
3985 =cut
3986
3987 sub _process() {
3988 state $done++ && return;
3989 #
3990 _error();
3991 _iostream();
3992 _properties();
3993 _stdinc();
3994 #
3995 _typedef_and_export SDL_Process => Void;
3996 _affix_and_export SDL_CreateProcess => [ Pointer [String], Bool ], Pointer [ SDL_Process() ];
3997 _enum_and_export SDL_ProcessIO =>
3998 [ 'SDL_PROCESS_STDIO_INHERITED', 'SDL_PROCESS_STDIO_NULL', 'SDL_PROCESS_STDIO_APP', 'SDL_PROCESS_STDIO_REDIRECT' ];
3999 _affix_and_export SDL_CreateProcessWithProperties => [ SDL_PropertiesID() ], Pointer [ SDL_Process() ];
4000 _const_and_export SDL_PROP_PROCESS_CREATE_ARGS_POINTER => 'SDL.process.create.args';
4001 _const_and_export SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER => 'SDL.process.create.environment';
4002 _const_and_export SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING => 'SDL.process.create.working_directory';
4003 _const_and_export SDL_PROP_PROCESS_CREATE_STDIN_NUMBER => 'SDL.process.create.stdin_option';
4004 _const_and_export SDL_PROP_PROCESS_CREATE_STDIN_POINTER => 'SDL.process.create.stdin_source';
4005 _const_and_export SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER => 'SDL.process.create.stdout_option';
4006 _const_and_export SDL_PROP_PROCESS_CREATE_STDOUT_POINTER => 'SDL.process.create.stdout_source';
4007 _const_and_export SDL_PROP_PROCESS_CREATE_STDERR_NUMBER => 'SDL.process.create.stderr_option';
4008 _const_and_export SDL_PROP_PROCESS_CREATE_STDERR_POINTER => 'SDL.process.create.stderr_source';
4009 _const_and_export SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN => 'SDL.process.create.stderr_to_stdout';
4010 _const_and_export SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN => 'SDL.process.create.background';
4011 _const_and_export SDL_PROP_PROCESS_CREATE_CMDLINE_STRING => 'SDL.process.create.cmdline';
4012 _affix_and_export SDL_GetProcessProperties => [ Pointer [ SDL_Process() ] ], SDL_PropertiesID();
4013 _const_and_export SDL_PROP_PROCESS_PID_NUMBER => 'SDL.process.pid';
4014 _const_and_export SDL_PROP_PROCESS_STDIN_POINTER => 'SDL.process.stdin';
4015 _const_and_export SDL_PROP_PROCESS_STDOUT_POINTER => 'SDL.process.stdout';
4016 _const_and_export SDL_PROP_PROCESS_STDERR_POINTER => 'SDL.process.stderr';
4017 _const_and_export SDL_PROP_PROCESS_BACKGROUND_BOOLEAN => 'SDL.process.background';
4018 _affix_and_export SDL_ReadProcess => [ Pointer [ SDL_Process() ], Pointer [Size_t], Pointer [Int] ], Pointer [Void];
4019 _affix_and_export SDL_GetProcessInput => [ Pointer [ SDL_Process() ] ], Pointer [ SDL_IOStream() ];
4020 _affix_and_export SDL_GetProcessOutput => [ Pointer [ SDL_Process() ] ], Pointer [ SDL_IOStream() ];
4021 _affix_and_export SDL_KillProcess => [ Pointer [ SDL_Process() ], Bool ], Bool;
4022 _affix_and_export SDL_WaitProcess => [ Pointer [ SDL_Process() ], Bool, Pointer [Int] ], Bool;
4023 _affix_and_export SDL_DestroyProcess => [ Pointer [ SDL_Process() ] ], Void;
4024 }
4025
4026 =head3 C<:properties> - Object Properties
4027
4028 A property is a variable that can be created and retrieved by name at runtime.
4029
4030 See L<SDL3: CategoryProperties|https://wiki.libsdl.org/SDL3/CategoryProperties>
4031
4032 =cut
4033
4034 sub _properties() {
4035 state $done++ && return;
4036 #
4037 _error();
4038 _stdinc();
4039 #
4040 _typedef_and_export SDL_PropertiesID => UInt32;
4041 _enum_and_export SDL_PropertyType => [
4042 'SDL_PROPERTY_TYPE_INVALID', 'SDL_PROPERTY_TYPE_POINTER', 'SDL_PROPERTY_TYPE_STRING', 'SDL_PROPERTY_TYPE_NUMBER',
4043 'SDL_PROPERTY_TYPE_FLOAT', 'SDL_PROPERTY_TYPE_BOOLEAN'
4044 ];
4045 _const_and_export SDL_PROP_NAME_STRING => 'SDL.name';
4046 _affix_and_export SDL_GetGlobalProperties => [], SDL_PropertiesID();
4047 _affix_and_export SDL_CreateProperties => [], SDL_PropertiesID();
4048 _affix_and_export SDL_CopyProperties => [ SDL_PropertiesID(), SDL_PropertiesID() ], Bool;
4049 _affix_and_export SDL_LockProperties => [ SDL_PropertiesID() ], Bool;
4050 _affix_and_export SDL_UnlockProperties => [ SDL_PropertiesID() ], Void;
4051 _typedef_and_export SDL_CleanupPropertyCallback => Callback [ [ Pointer [Void], Pointer [Void] ] => Void ];
4052 _affix_and_export
4053 SDL_SetPointerPropertyWithCleanup => [ SDL_PropertiesID(), String, Pointer [Void], SDL_CleanupPropertyCallback(), Pointer [Void] ],
4054 Bool;
4055 _affix_and_export SDL_SetPointerProperty => [ SDL_PropertiesID(), String, Pointer [Void] ], Bool;
4056 _affix_and_export SDL_SetStringProperty => [ SDL_PropertiesID(), String, String ], Bool;
4057 _affix_and_export SDL_SetNumberProperty => [ SDL_PropertiesID(), String, SInt64 ], Bool;
4058 _affix_and_export SDL_SetFloatProperty => [ SDL_PropertiesID(), String, Float ], Bool;
4059 _affix_and_export SDL_SetBooleanProperty => [ SDL_PropertiesID(), String, Bool ], Bool;
4060 _affix_and_export SDL_HasProperty => [ SDL_PropertiesID(), String ], Bool;
4061 _affix_and_export SDL_GetPropertyType => [ SDL_PropertiesID(), String ], SDL_PropertyType();
4062 _affix_and_export SDL_GetPointerProperty => [ SDL_PropertiesID(), String, Pointer [Void] ], Pointer [Void];
4063 _affix_and_export SDL_GetStringProperty => [ SDL_PropertiesID(), String, String ], String;
4064 _affix_and_export SDL_GetNumberProperty => [ SDL_PropertiesID(), String, SInt64 ], SInt64;
4065 _affix_and_export SDL_GetFloatProperty => [ SDL_PropertiesID(), String, Float ], Float;
4066 _affix_and_export SDL_GetBooleanProperty => [ SDL_PropertiesID(), String, Bool ], Bool;
4067 _affix_and_export SDL_ClearProperty => [ SDL_PropertiesID(), String ], Bool;
4068 _typedef_and_export SDL_EnumeratePropertiesCallback => Callback [ [ Pointer [Void], SDL_PropertiesID(), String ] => Void ];
4069 _affix_and_export
4070 SDL_EnumerateProperties => [ SDL_PropertiesID(), SDL_EnumeratePropertiesCallback(), Pointer [Void] ],
4071 Bool;
4072 _affix_and_export SDL_DestroyProperties => [ SDL_PropertiesID() ], Void;
4073 }
4074
4075 =head3 C<:rect> - Rectangle Functions
4076
4077 Some helper functions for managing rectangles and 2D points, in both integer and floating point versions.
4078
4079 See L<SDL3: CategoryRect|https://wiki.libsdl.org/SDL3/CategoryRect>
4080
4081 =cut
4082
4083 sub _rect() {
4084 state $done++ && return;
4085 _error();
4086 _stdinc();
4087 #
4088 _typedef_and_export SDL_Point => Struct [ x => Int, y => Int ];
4089 _typedef_and_export SDL_FPoint => Struct [ x => Float, y => Float ];
4090 _typedef_and_export SDL_Rect => Struct [ x => Int, y => Int, w => Int, h => Int ];
4091 _typedef_and_export SDL_FRect => Struct [ x => Float, y => Float, w => Float, h => Float ];
4092 _func_and_export SDL_PointInRect => sub ( $p, $r ) {
4093 return ( $p &&
4094 $r &&
4095 ( $p->{x} >= $r->{x} ) &&
4096 ( $p->{x} < ( $r->{x} + $r->{w} ) ) &&
4097 ( $p->{y} >= $r->{y} ) &&
4098 ( $p->{y} < ( $r->{y} + $r->{h} ) ) ) ? 1 : 0;
4099 };
4100 _func_and_export SDL_RectEmpty => sub ($r) { ( ( !$r ) || ( $r->{w} <= 0 ) || ( $r->{h} <= 0 ) ) ? 1 : 0 };
4101 _func_and_export SDL_RectsEqual => sub ( $a, $b ) {
4102 return ( $a && $b && ( $a->{x} == $b->{x} ) && ( $a->{y} == $b->{y} ) && ( $a->{w} == $b->{w} ) && ( $a->{h} == $b->{h} ) ) ? 1 : 0;
4103 };
4104 _affix_and_export SDL_HasRectIntersection => [ Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ] ], Bool;
4105 _affix_and_export SDL_GetRectIntersection => [ Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ] ], Bool;
4106 _affix_and_export SDL_GetRectUnion => [ Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ] ], Bool;
4107 _affix_and_export SDL_GetRectEnclosingPoints => [ Pointer [ SDL_Point() ], Int, Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ] ], Bool;
4108 _affix_and_export SDL_GetRectAndLineIntersection => [ Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Rect() ] ], Bool;
4109 _func_and_export SDL_PointInRectFloat => sub ( $p, $r ) {
4110 return ( $p &&
4111 $r &&
4112 ( $p->{x} >= $r->{x} ) &&
4113 ( $p->{x} <= ( $r->{x} + $r->{w} ) ) &&
4114 ( $p->{y} >= $r->{y} ) &&
4115 ( $p->{y} <= ( $r->{y} + $r->{h} ) ) ) ? 1 : 0;
4116 };
4117 _func_and_export SDL_RectEmptyFloat => sub ($r) {
4118 return ( ( !$r ) || ( $r->{w} < 0.0 ) || ( $r->{h} < 0.0 ) ) ? 1 : 0;
4119 };
4120 _func_and_export SDL_RectsEqualEpsilon => sub ( $a, $b, $epsilon ) {
4121 return (
4122 $a && $b && (
4123 ( $a == $b ) ||
4124 ( ( SDL_fabsf( $a->{x} - $b->{x} ) <= $epsilon ) &&
4125 ( SDL_fabsf( $a->{y} - $b->{y} ) <= $epsilon ) &&
4126 ( SDL_fabsf( $a->{w} - $b->{w} ) <= $epsilon ) &&
4127 ( SDL_fabsf( $a->{h} - $b->{h} ) <= $epsilon ) )
4128 )
4129 ) ? 1 : 0;
4130 };
4131 _const_and_export SDL_FLT_EPSILON => 1.1920928955078125e-07;
4132 _func_and_export SDL_RectsEqualFloat => sub ( $a, $b ) {
4133 SDL_RectsEqualEpsilon( $a, $b, SDL_FLT_EPSILON() );
4134 };
4135 _affix_and_export SDL_HasRectIntersectionFloat => [ Pointer [ SDL_FRect() ], Pointer [ SDL_FRect() ] ], Bool;
4136 _affix_and_export SDL_GetRectIntersectionFloat => [ Pointer [ SDL_FRect() ], Pointer [ SDL_FRect() ], Pointer [ SDL_FRect() ] ], Bool;
4137 _affix_and_export SDL_GetRectUnionFloat => [ Pointer [ SDL_FRect() ], Pointer [ SDL_FRect() ], Pointer [ SDL_FRect() ] ], Bool;
4138 _affix_and_export SDL_GetRectEnclosingPointsFloat => [ Pointer [ SDL_FRect() ], Int, Pointer [ SDL_FRect() ], Pointer [ SDL_FRect() ] ], Bool;
4139 _affix_and_export
4140 SDL_GetRectAndLineIntersectionFloat => [ Pointer [ SDL_FRect() ], Pointer [Float], Pointer [Float], Pointer [Float], Pointer [Float] ],
4141 Bool;
4142 }
4143
4144 =head3 C<:render> - 2D Accelerated Rendering
4145
4146 SDL 2D rendering functions.
4147
4148 See L<SDL3: CategoryRender|https://wiki.libsdl.org/SDL3/CategoryRender>
4149
4150 =cut
4151
4152 sub _render() {
4153 state $done++ && return;
4154 #
4155 _blendmode();
4156 _error();
4157 _events();
4158 _gpu();
4159 _pixels();
4160 _properties();
4161 _rect();
4162 _stdinc();
4163 _surface();
4164 _video();
4165 #
4166 _const_and_export SDL_SOFTWARE_RENDERER => 'software';
4167 _const_and_export SDL_GPU_RENDERER => 'gpu';
4168 _typedef_and_export SDL_Vertex => Struct [ position => SDL_FPoint(), color => SDL_FColor(), tex_coord => SDL_FPoint() ];
4169 _enum_and_export SDL_TextureAccess => [ 'SDL_TEXTUREACCESS_STATIC', 'SDL_TEXTUREACCESS_STREAMING', 'SDL_TEXTUREACCESS_TARGET' ];
4170 _enum_and_export SDL_TextureAddressMode =>
4171 [ [ SDL_TEXTURE_ADDRESS_INVALID => -1 ], 'SDL_TEXTURE_ADDRESS_AUTO', 'SDL_TEXTURE_ADDRESS_CLAMP', 'SDL_TEXTURE_ADDRESS_WRAP' ];
4172 _enum_and_export SDL_RendererLogicalPresentation => [
4173 'SDL_LOGICAL_PRESENTATION_DISABLED', 'SDL_LOGICAL_PRESENTATION_STRETCH',
4174 'SDL_LOGICAL_PRESENTATION_LETTERBOX', 'SDL_LOGICAL_PRESENTATION_OVERSCAN',
4175 'SDL_LOGICAL_PRESENTATION_INTEGER_SCALE'
4176 ];
4177 _typedef_and_export SDL_Renderer => Void;
4178 _typedef_and_export SDL_Texture => Struct [ format => SDL_PixelFormat(), w => Int, h => Int, refcount => Int ];
4179 _affix_and_export SDL_GetNumRenderDrivers => [], Int;
4180 _affix_and_export SDL_GetRenderDriver => [Int], String;
4181 _affix_and_export
4182 SDL_CreateWindowAndRenderer =>
4183 [ String, Int, Int, SDL_WindowFlags(), Pointer [ Pointer [ SDL_Window() ] ], Pointer [ Pointer [ SDL_Renderer() ] ] ],
4184 Bool;
4185 _affix_and_export SDL_CreateRenderer => [ Pointer [ SDL_Window() ], String ], Pointer [ SDL_Renderer() ];
4186 _affix_and_export SDL_CreateRendererWithProperties => [ SDL_PropertiesID() ], Pointer [ SDL_Renderer() ];
4187 _const_and_export SDL_PROP_RENDERER_CREATE_NAME_STRING => 'SDL.renderer.create.name';
4188 _const_and_export SDL_PROP_RENDERER_CREATE_WINDOW_POINTER => 'SDL.renderer.create.window';
4189 _const_and_export SDL_PROP_RENDERER_CREATE_SURFACE_POINTER => 'SDL.renderer.create.surface';
4190 _const_and_export SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER => 'SDL.renderer.create.output_colorspace';
4191 _const_and_export SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => 'SDL.renderer.create.present_vsync';
4192 _const_and_export SDL_PROP_RENDERER_CREATE_GPU_DEVICE_POINTER => 'SDL.renderer.create.gpu.device';
4193 _const_and_export SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN => 'SDL.renderer.create.gpu.shaders_spirv';
4194 _const_and_export SDL_PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEAN => 'SDL.renderer.create.gpu.shaders_dxil';
4195 _const_and_export SDL_PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEAN => 'SDL.renderer.create.gpu.shaders_msl';
4196 _const_and_export SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER => 'SDL.renderer.create.vulkan.instance';
4197 _const_and_export SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER => 'SDL.renderer.create.vulkan.surface';
4198 _const_and_export SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER => 'SDL.renderer.create.vulkan.physical_device';
4199 _const_and_export SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER => 'SDL.renderer.create.vulkan.device';
4200 _const_and_export SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER =>
4201 'SDL.renderer.create.vulkan.graphics_queue_family_index';
4202 _const_and_export SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER =>
4203 'SDL.renderer.create.vulkan.present_queue_family_index';
4204
4205 #~ _affix_and_export
4206 #~ SDL_CreateGPURenderer => [ Pointer [ SDL_GPUDevice() ], Pointer [ SDL_Window() ] ],
4207 #~ Pointer [ SDL_Renderer() ];
4208 #~ _affix_and_export SDL_GetGPURendererDevice => [ Pointer [ SDL_Renderer() ] ], Pointer [ SDL_GPUDevice() ];
4209 _affix_and_export SDL_CreateSoftwareRenderer => [ Pointer [ SDL_Surface() ] ], Pointer [ SDL_Renderer() ];
4210 _affix_and_export SDL_GetRenderer => [ Pointer [ SDL_Window() ] ], Pointer [ SDL_Renderer() ];
4211 _affix_and_export SDL_GetRenderWindow => [ Pointer [ SDL_Renderer() ] ], Pointer [ SDL_Window() ];
4212 _affix_and_export SDL_GetRendererName => [ Pointer [ SDL_Renderer() ] ], String;
4213 _affix_and_export SDL_GetRendererProperties => [ Pointer [ SDL_Renderer() ] ], SDL_PropertiesID();
4214 _const_and_export SDL_PROP_RENDERER_NAME_STRING => 'SDL.renderer.name';
4215 _const_and_export SDL_PROP_RENDERER_WINDOW_POINTER => 'SDL.renderer.window';
4216 _const_and_export SDL_PROP_RENDERER_SURFACE_POINTER => 'SDL.renderer.surface';
4217 _const_and_export SDL_PROP_RENDERER_VSYNC_NUMBER => 'SDL.renderer.vsync';
4218 _const_and_export SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER => 'SDL.renderer.max_texture_size';
4219 _const_and_export SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER => 'SDL.renderer.texture_formats';
4220 _const_and_export SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN => 'SDL.renderer.texture_wrapping';
4221 _const_and_export SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER => 'SDL.renderer.output_colorspace';
4222 _const_and_export SDL_PROP_RENDERER_HDR_ENABLED_BOOLEAN => 'SDL.renderer.HDR_enabled';
4223 _const_and_export SDL_PROP_RENDERER_SDR_WHITE_POINT_FLOAT => 'SDL.renderer.SDR_white_point';
4224 _const_and_export SDL_PROP_RENDERER_HDR_HEADROOM_FLOAT => 'SDL.renderer.HDR_headroom';
4225 _const_and_export SDL_PROP_RENDERER_D3D9_DEVICE_POINTER => 'SDL.renderer.d3d9.device';
4226 _const_and_export SDL_PROP_RENDERER_D3D11_DEVICE_POINTER => 'SDL.renderer.d3d11.device';
4227 _const_and_export SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER => 'SDL.renderer.d3d11.swap_chain';
4228 _const_and_export SDL_PROP_RENDERER_D3D12_DEVICE_POINTER => 'SDL.renderer.d3d12.device';
4229 _const_and_export SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER => 'SDL.renderer.d3d12.swap_chain';
4230 _const_and_export SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER => 'SDL.renderer.d3d12.command_queue';
4231 _const_and_export SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER => 'SDL.renderer.vulkan.instance';
4232 _const_and_export SDL_PROP_RENDERER_VULKAN_SURFACE_NUMBER => 'SDL.renderer.vulkan.surface';
4233 _const_and_export SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER => 'SDL.renderer.vulkan.physical_device';
4234 _const_and_export SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER => 'SDL.renderer.vulkan.device';
4235 _const_and_export SDL_PROP_RENDERER_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER => 'SDL.renderer.vulkan.graphics_queue_family_index';
4236 _const_and_export SDL_PROP_RENDERER_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER => 'SDL.renderer.vulkan.present_queue_family_index';
4237 _const_and_export SDL_PROP_RENDERER_VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBER => 'SDL.renderer.vulkan.swapchain_image_count';
4238 _const_and_export SDL_PROP_RENDERER_GPU_DEVICE_POINTER => 'SDL.renderer.gpu.device';
4239 _affix_and_export SDL_GetRenderOutputSize => [ Pointer [ SDL_Renderer() ], Pointer [Int], Pointer [Int] ], Bool;
4240 _affix_and_export SDL_GetCurrentRenderOutputSize => [ Pointer [ SDL_Renderer() ], Pointer [Int], Pointer [Int] ], Bool;
4241 _affix_and_export
4242 SDL_CreateTexture => [ Pointer [ SDL_Renderer() ], SDL_PixelFormat(), SDL_TextureAccess(), Int, Int ],
4243 Pointer [ SDL_Texture() ];
4244 _affix_and_export
4245 SDL_CreateTextureFromSurface => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Surface() ] ],
4246 Pointer [ SDL_Texture() ];
4247 _affix_and_export
4248 SDL_CreateTextureWithProperties => [ Pointer [ SDL_Renderer() ], SDL_PropertiesID() ],
4249 Pointer [ SDL_Texture() ];
4250 _const_and_export SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER => 'SDL.texture.create.colorspace';
4251 _const_and_export SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER => 'SDL.texture.create.format';
4252 _const_and_export SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER => 'SDL.texture.create.access';
4253 _const_and_export SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER => 'SDL.texture.create.width';
4254 _const_and_export SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER => 'SDL.texture.create.height';
4255 _const_and_export SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER => 'SDL.texture.create.palette';
4256 _const_and_export SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT => 'SDL.texture.create.SDR_white_point';
4257 _const_and_export SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT => 'SDL.texture.create.HDR_headroom';
4258 _const_and_export SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER => 'SDL.texture.create.d3d11.texture';
4259 _const_and_export SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER => 'SDL.texture.create.d3d11.texture_u';
4260 _const_and_export SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER => 'SDL.texture.create.d3d11.texture_v';
4261 _const_and_export SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER => 'SDL.texture.create.d3d12.texture';
4262 _const_and_export SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER => 'SDL.texture.create.d3d12.texture_u';
4263 _const_and_export SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER => 'SDL.texture.create.d3d12.texture_v';
4264 _const_and_export SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER => 'SDL.texture.create.metal.pixelbuffer';
4265 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER => 'SDL.texture.create.opengl.texture';
4266 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER => 'SDL.texture.create.opengl.texture_uv';
4267 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER => 'SDL.texture.create.opengl.texture_u';
4268 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER => 'SDL.texture.create.opengl.texture_v';
4269 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER => 'SDL.texture.create.opengles2.texture';
4270 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER => 'SDL.texture.create.opengles2.texture_uv';
4271 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER => 'SDL.texture.create.opengles2.texture_u';
4272 _const_and_export SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER => 'SDL.texture.create.opengles2.texture_v';
4273 _const_and_export SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER => 'SDL.texture.create.vulkan.texture';
4274 _const_and_export SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER => 'SDL.texture.create.gpu.texture';
4275 _const_and_export SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_POINTER => 'SDL.texture.create.gpu.texture_uv';
4276 _const_and_export SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_U_POINTER => 'SDL.texture.create.gpu.texture_u';
4277 _const_and_export SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_V_POINTER => 'SDL.texture.create.gpu.texture_v';
4278 _affix_and_export SDL_GetTextureProperties => [ Pointer [ SDL_Texture() ] ], SDL_PropertiesID();
4279 _const_and_export SDL_PROP_TEXTURE_COLORSPACE_NUMBER => 'SDL.texture.colorspace';
4280 _const_and_export SDL_PROP_TEXTURE_FORMAT_NUMBER => 'SDL.texture.format';
4281 _const_and_export SDL_PROP_TEXTURE_ACCESS_NUMBER => 'SDL.texture.access';
4282 _const_and_export SDL_PROP_TEXTURE_WIDTH_NUMBER => 'SDL.texture.width';
4283 _const_and_export SDL_PROP_TEXTURE_HEIGHT_NUMBER => 'SDL.texture.height';
4284 _const_and_export SDL_PROP_TEXTURE_SDR_WHITE_POINT_FLOAT => 'SDL.texture.SDR_white_point';
4285 _const_and_export SDL_PROP_TEXTURE_HDR_HEADROOM_FLOAT => 'SDL.texture.HDR_headroom';
4286 _const_and_export SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER => 'SDL.texture.d3d11.texture';
4287 _const_and_export SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER => 'SDL.texture.d3d11.texture_u';
4288 _const_and_export SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER => 'SDL.texture.d3d11.texture_v';
4289 _const_and_export SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER => 'SDL.texture.d3d12.texture';
4290 _const_and_export SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER => 'SDL.texture.d3d12.texture_u';
4291 _const_and_export SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER => 'SDL.texture.d3d12.texture_v';
4292 _const_and_export SDL_PROP_TEXTURE_OPENGL_TEXTURE_NUMBER => 'SDL.texture.opengl.texture';
4293 _const_and_export SDL_PROP_TEXTURE_OPENGL_TEXTURE_UV_NUMBER => 'SDL.texture.opengl.texture_uv';
4294 _const_and_export SDL_PROP_TEXTURE_OPENGL_TEXTURE_U_NUMBER => 'SDL.texture.opengl.texture_u';
4295 _const_and_export SDL_PROP_TEXTURE_OPENGL_TEXTURE_V_NUMBER => 'SDL.texture.opengl.texture_v';
4296 _const_and_export SDL_PROP_TEXTURE_OPENGL_TEXTURE_TARGET_NUMBER => 'SDL.texture.opengl.target';
4297 _const_and_export SDL_PROP_TEXTURE_OPENGL_TEX_W_FLOAT => 'SDL.texture.opengl.tex_w';
4298 _const_and_export SDL_PROP_TEXTURE_OPENGL_TEX_H_FLOAT => 'SDL.texture.opengl.tex_h';
4299 _const_and_export SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_NUMBER => 'SDL.texture.opengles2.texture';
4300 _const_and_export SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_UV_NUMBER => 'SDL.texture.opengles2.texture_uv';
4301 _const_and_export SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_U_NUMBER => 'SDL.texture.opengles2.texture_u';
4302 _const_and_export SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_V_NUMBER => 'SDL.texture.opengles2.texture_v';
4303 _const_and_export SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET_NUMBER => 'SDL.texture.opengles2.target';
4304 _const_and_export SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER => 'SDL.texture.vulkan.texture';
4305 _const_and_export SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER => 'SDL.texture.gpu.texture';
4306 _const_and_export SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER => 'SDL.texture.gpu.texture_uv';
4307 _const_and_export SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER => 'SDL.texture.gpu.texture_u';
4308 _const_and_export SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER => 'SDL.texture.gpu.texture_v';
4309 _affix_and_export SDL_GetRendererFromTexture => [ Pointer [ SDL_Texture() ] ], Pointer [ SDL_Renderer() ];
4310 _affix_and_export SDL_GetTextureSize => [ Pointer [ SDL_Texture() ], Pointer [Float], Pointer [Float] ], Bool;
4311
4312 #~ _affix_and_export SDL_SetTexturePalette => [ Pointer [ SDL_Texture() ], Pointer [ SDL_Palette() ] ], Bool;
4313 #~ _affix_and_export SDL_GetTexturePalette => [ Pointer [ SDL_Texture() ] ], Pointer [ SDL_Palette() ];
4314 _affix_and_export SDL_SetTextureColorMod => [ Pointer [ SDL_Texture() ], UInt8, UInt8, UInt8 ], Bool;
4315 _affix_and_export SDL_SetTextureColorModFloat => [ Pointer [ SDL_Texture() ], Float, Float, Float ], Bool;
4316 _affix_and_export
4317 SDL_GetTextureColorMod => [ Pointer [ SDL_Texture() ], Pointer [UInt8], Pointer [UInt8], Pointer [UInt8] ],
4318 Bool;
4319 _affix_and_export
4320 SDL_GetTextureColorModFloat => [ Pointer [ SDL_Texture() ], Pointer [Float], Pointer [Float], Pointer [Float] ],
4321 Bool;
4322 _affix_and_export SDL_SetTextureAlphaMod => [ Pointer [ SDL_Texture() ], UInt8 ], Bool;
4323 _affix_and_export SDL_SetTextureAlphaModFloat => [ Pointer [ SDL_Texture() ], Float ], Bool;
4324 _affix_and_export SDL_GetTextureAlphaMod => [ Pointer [ SDL_Texture() ], Pointer [UInt8] ], Bool;
4325 _affix_and_export SDL_GetTextureAlphaModFloat => [ Pointer [ SDL_Texture() ], Pointer [Float] ], Bool;
4326 _affix_and_export SDL_SetTextureBlendMode => [ Pointer [ SDL_Texture() ], SDL_BlendMode() ], Bool;
4327 _affix_and_export SDL_GetTextureBlendMode => [ Pointer [ SDL_Texture() ], Pointer [ SDL_BlendMode() ] ], Bool;
4328 _affix_and_export SDL_SetTextureScaleMode => [ Pointer [ SDL_Texture() ], SDL_ScaleMode() ], Bool;
4329 _affix_and_export SDL_GetTextureScaleMode => [ Pointer [ SDL_Texture() ], Pointer [ SDL_ScaleMode() ] ], Bool;
4330 _affix_and_export
4331 SDL_UpdateTexture => [ Pointer [ SDL_Texture() ], Pointer [ SDL_Rect() ], Pointer [Void], Int ],
4332 Bool;
4333 _affix_and_export
4334 SDL_UpdateYUVTexture =>
4335 [ Pointer [ SDL_Texture() ], Pointer [ SDL_Rect() ], Pointer [UInt8], Int, Pointer [UInt8], Int, Pointer [UInt8], Int ],
4336 Bool;
4337 _affix_and_export
4338 SDL_UpdateNVTexture => [ Pointer [ SDL_Texture() ], Pointer [ SDL_Rect() ], Pointer [UInt8], Int, Pointer [UInt8], Int ],
4339 Bool;
4340 _affix_and_export
4341 SDL_LockTexture => [ Pointer [ SDL_Texture() ], Pointer [ SDL_Rect() ], Pointer [ Pointer [Void] ], Pointer [Int] ],
4342 Bool;
4343 _affix_and_export
4344 SDL_LockTextureToSurface => [ Pointer [ SDL_Texture() ], Pointer [ SDL_Rect() ], Pointer [ Pointer [ SDL_Surface() ] ] ],
4345 Bool;
4346 _affix_and_export SDL_UnlockTexture => [ Pointer [ SDL_Texture() ] ], Void;
4347 _affix_and_export SDL_SetRenderTarget => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Texture() ] ], Bool;
4348 _affix_and_export SDL_GetRenderTarget => [ Pointer [ SDL_Renderer() ] ], Pointer [ SDL_Texture() ];
4349 _affix_and_export
4350 SDL_SetRenderLogicalPresentation => [ Pointer [ SDL_Renderer() ], Int, Int, SDL_RendererLogicalPresentation() ],
4351 Bool;
4352 _affix_and_export
4353 SDL_GetRenderLogicalPresentation =>
4354 [ Pointer [ SDL_Renderer() ], Pointer [Int], Pointer [Int], Pointer [ SDL_RendererLogicalPresentation() ] ],
4355 Bool;
4356 _affix_and_export SDL_GetRenderLogicalPresentationRect => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_FRect() ] ], Bool;
4357 _affix_and_export
4358 SDL_RenderCoordinatesFromWindow => [ Pointer [ SDL_Renderer() ], Float, Float, Pointer [Float], Pointer [Float] ],
4359 Bool;
4360 _affix_and_export
4361 SDL_RenderCoordinatesToWindow => [ Pointer [ SDL_Renderer() ], Float, Float, Pointer [Float], Pointer [Float] ],
4362 Bool;
4363 _affix_and_export
4364 SDL_ConvertEventToRenderCoordinates => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Event() ] ],
4365 Bool;
4366 _affix_and_export SDL_SetRenderViewport => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Rect() ] ], Bool;
4367 _affix_and_export SDL_GetRenderViewport => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Rect() ] ], Bool;
4368 _affix_and_export SDL_RenderViewportSet => [ Pointer [ SDL_Renderer() ] ], Bool;
4369 _affix_and_export SDL_GetRenderSafeArea => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Rect() ] ], Bool;
4370 _affix_and_export SDL_SetRenderClipRect => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Rect() ] ], Bool;
4371 _affix_and_export SDL_GetRenderClipRect => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Rect() ] ], Bool;
4372 _affix_and_export SDL_RenderClipEnabled => [ Pointer [ SDL_Renderer() ] ], Bool;
4373 _affix_and_export SDL_SetRenderScale => [ Pointer [ SDL_Renderer() ], Float, Float ], Bool;
4374 _affix_and_export SDL_GetRenderScale => [ Pointer [ SDL_Renderer() ], Pointer [Float], Pointer [Float] ], Bool;
4375 _affix_and_export SDL_SetRenderDrawColor => [ Pointer [ SDL_Renderer() ], UInt8, UInt8, UInt8, UInt8 ], Bool;
4376 _affix_and_export SDL_SetRenderDrawColorFloat => [ Pointer [ SDL_Renderer() ], Float, Float, Float, Float ], Bool;
4377 _affix_and_export
4378 SDL_GetRenderDrawColor => [ Pointer [ SDL_Renderer() ], Pointer [UInt8], Pointer [UInt8], Pointer [UInt8], Pointer [UInt8] ],
4379 Bool;
4380 _affix_and_export
4381 SDL_GetRenderDrawColorFloat => [ Pointer [ SDL_Renderer() ], Pointer [Float], Pointer [Float], Pointer [Float], Pointer [Float] ],
4382 Bool;
4383 _affix_and_export SDL_SetRenderColorScale => [ Pointer [ SDL_Renderer() ], Float ], Bool;
4384 _affix_and_export SDL_GetRenderColorScale => [ Pointer [ SDL_Renderer() ], Pointer [Float] ], Bool;
4385 _affix_and_export SDL_SetRenderDrawBlendMode => [ Pointer [ SDL_Renderer() ], SDL_BlendMode() ], Bool;
4386 _affix_and_export SDL_GetRenderDrawBlendMode => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_BlendMode() ] ], Bool;
4387 _affix_and_export SDL_RenderClear => [ Pointer [ SDL_Renderer() ] ], Bool;
4388 _affix_and_export SDL_RenderPoint => [ Pointer [ SDL_Renderer() ], Float, Float ], Bool;
4389 _affix_and_export SDL_RenderPoints => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_FPoint() ], Int ], Bool;
4390 _affix_and_export SDL_RenderLine => [ Pointer [ SDL_Renderer() ], Float, Float, Float, Float ], Bool;
4391 _affix_and_export SDL_RenderLines => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_FPoint() ], Int ], Bool;
4392 _affix_and_export SDL_RenderRect => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_FRect() ] ], Bool;
4393 _affix_and_export SDL_RenderRects => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_FRect() ], Int ], Bool;
4394 _affix_and_export SDL_RenderFillRect => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_FRect() ] ], Bool;
4395 _affix_and_export SDL_RenderFillRects => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_FRect() ], Int ], Bool;
4396 _affix_and_export
4397 SDL_RenderTexture => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Texture() ], Pointer [ SDL_FRect() ], Pointer [ SDL_FRect() ] ],
4398 Bool;
4399 _affix_and_export
4400 SDL_RenderTextureRotated => [
4401 Pointer [ SDL_Renderer() ],
4402 Pointer [ SDL_Texture() ],
4403 Pointer [ SDL_FRect() ],
4404 Pointer [ SDL_FRect() ],
4405 Double,
4406 Pointer [ SDL_FPoint() ],
4407 SDL_FlipMode()
4408 ],
4409 Bool;
4410 _affix_and_export
4411 SDL_RenderTextureAffine => [
4412 Pointer [ SDL_Renderer() ],
4413 Pointer [ SDL_Texture() ],
4414 Pointer [ SDL_FRect() ],
4415 Pointer [ SDL_FPoint() ],
4416 Pointer [ SDL_FPoint() ],
4417 Pointer [ SDL_FPoint() ]
4418 ],
4419 Bool;
4420 _affix_and_export
4421 SDL_RenderTextureTiled =>
4422 [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Texture() ], Pointer [ SDL_FRect() ], Float, Pointer [ SDL_FRect() ] ],
4423 Bool;
4424 _affix_and_export
4425 SDL_RenderTexture9Grid => [
4426 Pointer [ SDL_Renderer() ],
4427 Pointer [ SDL_Texture() ],
4428 Pointer [ SDL_FRect() ],
4429 Float, Float, Float, Float, Float, Pointer [ SDL_FRect() ]
4430 ],
4431 Bool;
4432
4433 #~ _affix_and_export
4434 #~ SDL_RenderTexture9GridTiled => [
4435 #~ Pointer [ SDL_Renderer() ],
4436 #~ Pointer [ SDL_Texture() ],
4437 #~ Pointer [ SDL_FRect() ],
4438 #~ Float, Float, Float, Float, Float, Pointer [ SDL_FRect() ], Float
4439 #~ ],
4440 #~ Bool;
4441 _affix_and_export
4442 SDL_RenderGeometry => [
4443 Const [ Pointer [ SDL_Renderer() ] ],
4444 Const [ Pointer [ SDL_Texture() ] ],
4445 Const [ Pointer [ SDL_Vertex() ] ],
4446 Int,
4447 Const [ Pointer [Int] ],
4448 Int
4449 ],
4450 Bool;
4451 _affix_and_export
4452 SDL_RenderGeometryRaw => [
4453 Pointer [ SDL_Renderer() ],
4454 Pointer [ SDL_Texture() ],
4455 Pointer [Float],
4456 Int, Pointer [ SDL_FColor() ],
4457 Int, Pointer [Float],
4458 Int, Int, Pointer [Void],
4459 Int, Int
4460 ],
4461 Bool;
4462
4463 #~ _affix_and_export
4464 #~ SDL_SetRenderTextureAddressMode => [ Pointer [ SDL_Renderer() ], SDL_TextureAddressMode(), SDL_TextureAddressMode() ],
4465 #~ Bool;
4466 #~ _affix_and_export
4467 #~ SDL_GetRenderTextureAddressMode =>
4468 #~ [ Pointer [ SDL_Renderer() ], Pointer [ SDL_TextureAddressMode() ], Pointer [ SDL_TextureAddressMode() ] ],
4469 #~ Bool;
4470 _affix_and_export SDL_RenderReadPixels => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_Rect() ] ], Pointer [ SDL_Surface() ];
4471 _affix_and_export SDL_RenderPresent => [ Pointer [ SDL_Renderer() ] ], Bool;
4472 _affix_and_export SDL_DestroyTexture => [ Pointer [ SDL_Texture() ] ], Void;
4473 _affix_and_export SDL_DestroyRenderer => [ Pointer [ SDL_Renderer() ] ], Void;
4474 _affix_and_export SDL_FlushRenderer => [ Pointer [ SDL_Renderer() ] ], Bool;
4475 _affix_and_export SDL_GetRenderMetalLayer => [ Pointer [ SDL_Renderer() ] ], Pointer [Void];
4476 _affix_and_export SDL_GetRenderMetalCommandEncoder => [ Pointer [ SDL_Renderer() ] ], Pointer [Void];
4477 _affix_and_export SDL_AddVulkanRenderSemaphores => [ Pointer [ SDL_Renderer() ], UInt32, SInt64, SInt64 ], Bool;
4478 _affix_and_export SDL_SetRenderVSync => [ Pointer [ SDL_Renderer() ], Int ], Bool;
4479 _const_and_export SDL_RENDERER_VSYNC_DISABLED => 0;
4480 _const_and_export SDL_RENDERER_VSYNC_ADAPTIVE => -1;
4481 _affix_and_export SDL_GetRenderVSync => [ Pointer [ SDL_Renderer() ], Pointer [Int] ], Bool;
4482 _const_and_export SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE => 8;
4483 _affix_and_export SDL_RenderDebugText => [ Pointer [ SDL_Renderer() ], Float, Float, String ], Bool;
4484
4485 #~ _affix_and_export SDL_RenderDebugTextFormat => [ Pointer [ SDL_Renderer() ], Float, Float, String, VarArgs ], Bool;
4486 #~ _affix_and_export SDL_SetDefaultTextureScaleMode => [ Pointer [ SDL_Renderer() ], SDL_ScaleMode() ], Bool;
4487 #~ _affix_and_export SDL_GetDefaultTextureScaleMode => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_ScaleMode() ] ], Bool;
4488 _typedef_and_export SDL_GPURenderStateCreateInfo => Struct [
4489 fragment_shader => Pointer [ SDL_GPUShader() ],
4490 num_sampler_bindings => SInt32,
4491 sampler_bindings => Pointer [ SDL_GPUTextureSamplerBinding() ],
4492 num_storage_textures => SInt32,
4493 storage_textures => Pointer [ Pointer [ SDL_GPUTexture() ] ],
4494 num_storage_buffers => SInt32,
4495 storage_buffers => Pointer [ Pointer [ SDL_GPUBuffer() ] ],
4496 props => SDL_PropertiesID()
4497 ];
4498 _typedef_and_export SDL_GPURenderState => Void;
4499
4500 #~ _affix_and_export
4501 #~ SDL_CreateGPURenderState => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_GPURenderStateCreateInfo() ] ],
4502 #~ Pointer [ SDL_GPURenderState() ];
4503 #~ _affix_and_export
4504 #~ SDL_SetGPURenderStateFragmentUniforms => [ Pointer [ SDL_GPURenderState() ], UInt32, Pointer [Void], UInt32 ],
4505 #~ Bool;
4506 #~ _affix_and_export SDL_SetGPURenderState => [ Pointer [ SDL_Renderer() ], Pointer [ SDL_GPURenderState() ] ], Bool;
4507 #~ _affix_and_export SDL_DestroyGPURenderState => [ Pointer [ SDL_GPURenderState() ] ], Void;
4508 }
4509
4510 =head3 C<:scancode> - Keyboard Scancodes
4511
4512 The SDL keyboard scancode representation.
4513
4514 An SDL scancode is the physical representation of a key on the keyboard, independent of language and keyboard mapping.
4515
4516 See L<SDL3: CategoryScancode|https://wiki.libsdl.org/SDL3/CategoryScancode>
4517
4518 =cut
4519
4520 sub _scancode() {
4521 state $done++ && return;
4522 _enum_and_export SDL_Scancode => [
4523 [ SDL_SCANCODE_A => 4 ], [ SDL_SCANCODE_B => 5 ], [ SDL_SCANCODE_C => 6 ], [ SDL_SCANCODE_D => 7 ], [ SDL_SCANCODE_E => 8 ],
4524 [ SDL_SCANCODE_F => 9 ], [ SDL_SCANCODE_G => 10 ], [ SDL_SCANCODE_H => 11 ], [ SDL_SCANCODE_I => 12 ], [ SDL_SCANCODE_J => 13 ],
4525 [ SDL_SCANCODE_K => 14 ], [ SDL_SCANCODE_L => 15 ], [ SDL_SCANCODE_M => 16 ], [ SDL_SCANCODE_N => 17 ], [ SDL_SCANCODE_O => 18 ],
4526 [ SDL_SCANCODE_P => 19 ], [ SDL_SCANCODE_Q => 20 ], [ SDL_SCANCODE_R => 21 ], [ SDL_SCANCODE_S => 22 ], [ SDL_SCANCODE_T => 23 ],
4527 [ SDL_SCANCODE_U => 24 ], [ SDL_SCANCODE_V => 25 ], [ SDL_SCANCODE_W => 26 ], [ SDL_SCANCODE_X => 27 ], [ SDL_SCANCODE_Y => 28 ],
4528 [ SDL_SCANCODE_Z => 29 ],
4529 #
4530 [ SDL_SCANCODE_1 => 30 ], [ SDL_SCANCODE_2 => 31 ], [ SDL_SCANCODE_3 => 32 ], [ SDL_SCANCODE_4 => 33 ], [ SDL_SCANCODE_5 => 34 ],
4531 [ SDL_SCANCODE_6 => 35 ], [ SDL_SCANCODE_7 => 36 ], [ SDL_SCANCODE_8 => 37 ], [ SDL_SCANCODE_9 => 38 ], [ SDL_SCANCODE_0 => 39 ],
4532 #
4533 [ SDL_SCANCODE_RETURN => 40 ], [ SDL_SCANCODE_ESCAPE => 41 ], [ SDL_SCANCODE_BACKSPACE => 42 ], [ SDL_SCANCODE_TAB => 43 ],
4534 [ SDL_SCANCODE_SPACE => 44 ],
4535 #
4536 [ SDL_SCANCODE_MINUS => 45 ], [ SDL_SCANCODE_EQUALS => 46 ], [ SDL_SCANCODE_LEFTBRACKET => 47 ], [ SDL_SCANCODE_RIGHTBRACKET => 48 ],
4537 [ SDL_SCANCODE_BACKSLASH => 49 ], # Located at the lower left of the return key on ISO
4538
4539 # keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE
4540 # SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL
4541 # LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN
4542 # and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German
4543 # layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO
4544 # SIGN in a French Windows layout.
4545 [ SDL_SCANCODE_NONUSHASH => 50 ], # ISO USB keyboards actually use this code instead
4546
4547 # of 49 for the same key, but all OSes I've seen treat the two codes identically. So,
4548 # as an implementor, unless your keyboard generates both of those codes and your OS
4549 # treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this
4550 # code. As a user, you should not rely on this code because SDL will never generate it
4551 # with most (all?) keyboards.
4552 [ SDL_SCANCODE_SEMICOLON => 51 ], [ SDL_SCANCODE_APOSTROPHE => 52 ],
4553 [ SDL_SCANCODE_GRAVE => 53 ], # Located in the top left corner (on both ANSI and
4554
4555 # ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and
4556 # UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout,
4557 # SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION
4558 # SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards),
4559 # CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards),
4560 # SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN
4561 # in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in
4562 # a Swiss German, German, or French Mac layout on ANSI keyboards.
4563 [ SDL_SCANCODE_COMMA => 54 ], [ SDL_SCANCODE_PERIOD => 55 ], [ SDL_SCANCODE_SLASH => 56 ],
4564 #
4565 [ SDL_SCANCODE_CAPSLOCK => 57 ],
4566 #
4567 [ SDL_SCANCODE_F1 => 58 ], [ SDL_SCANCODE_F2 => 59 ], [ SDL_SCANCODE_F3 => 60 ], [ SDL_SCANCODE_F4 => 61 ], [ SDL_SCANCODE_F5 => 62 ],
4568 [ SDL_SCANCODE_F6 => 63 ], [ SDL_SCANCODE_F7 => 64 ], [ SDL_SCANCODE_F8 => 65 ], [ SDL_SCANCODE_F9 => 66 ], [ SDL_SCANCODE_F10 => 67 ],
4569 [ SDL_SCANCODE_F11 => 68 ], [ SDL_SCANCODE_F12 => 69 ], [ SDL_SCANCODE_PRINTSCREEN => 70 ], [ SDL_SCANCODE_SCROLLLOCK => 71 ],
4570 [ SDL_SCANCODE_PAUSE => 72 ], [ SDL_SCANCODE_INSERT => 73 ], # insert on PC, help on some Mac keyboards (but does send code 73, not 117)
4571 [ SDL_SCANCODE_HOME => 74 ], [ SDL_SCANCODE_PAGEUP => 75 ], [ SDL_SCANCODE_DELETE => 76 ], [ SDL_SCANCODE_END => 77 ],
4572 [ SDL_SCANCODE_PAGEDOWN => 78 ], [ SDL_SCANCODE_RIGHT => 79 ], [ SDL_SCANCODE_LEFT => 80 ], [ SDL_SCANCODE_DOWN => 81 ],
4573 [ SDL_SCANCODE_UP => 82 ], [ SDL_SCANCODE_NUMLOCKCLEAR => 83 ], # num lock on PC, clear on Mac keyboards
4574 [ SDL_SCANCODE_KP_DIVIDE => 84 ], [ SDL_SCANCODE_KP_MULTIPLY => 85 ], [ SDL_SCANCODE_KP_MINUS => 86 ], [ SDL_SCANCODE_KP_PLUS => 87 ],
4575 [ SDL_SCANCODE_KP_ENTER => 88 ], [ SDL_SCANCODE_KP_1 => 89 ], [ SDL_SCANCODE_KP_2 => 90 ], [ SDL_SCANCODE_KP_3 => 91 ],
4576 [ SDL_SCANCODE_KP_4 => 92 ], [ SDL_SCANCODE_KP_5 => 93 ], [ SDL_SCANCODE_KP_6 => 94 ], [ SDL_SCANCODE_KP_7 => 95 ],
4577 [ SDL_SCANCODE_KP_8 => 96 ], [ SDL_SCANCODE_KP_9 => 97 ], [ SDL_SCANCODE_KP_0 => 98 ], [ SDL_SCANCODE_KP_PERIOD => 99 ],
4578 [ SDL_SCANCODE_NONUSBACKSLASH => 100 ], # This is the additional key that ISO keyboards
4579
4580 # have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and
4581 # TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US
4582 # or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German,
4583 # German, or French layout.
4584 [ SDL_SCANCODE_APPLICATION => 101 ], # windows contextual menu, compose
4585 [ SDL_SCANCODE_POWER => 102 ], # The USB document says this is a status flag,
4586
4587 # not a physical key - but some Mac keyboards
4588 # do have a power key.
4589 [ SDL_SCANCODE_KP_EQUALS => 103 ], [ SDL_SCANCODE_F13 => 104 ], [ SDL_SCANCODE_F14 => 105 ], [ SDL_SCANCODE_F15 => 106 ],
4590 [ SDL_SCANCODE_F16 => 107 ], [ SDL_SCANCODE_F17 => 108 ], [ SDL_SCANCODE_F18 => 109 ], [ SDL_SCANCODE_F19 => 110 ],
4591 [ SDL_SCANCODE_F20 => 111 ], [ SDL_SCANCODE_F21 => 112 ], [ SDL_SCANCODE_F22 => 113 ], [ SDL_SCANCODE_F23 => 114 ],
4592 [ SDL_SCANCODE_F24 => 115 ], [ SDL_SCANCODE_EXECUTE => 116 ], [ SDL_SCANCODE_HELP => 117 ], # AL Integrated Help Center
4593 [ SDL_SCANCODE_MENU => 118 ], # Menu (show menu)
4594 [ SDL_SCANCODE_SELECT => 119 ], [ SDL_SCANCODE_STOP => 120 ], # AC Stop
4595 [ SDL_SCANCODE_AGAIN => 121 ], # AC Redo/Repeat
4596 [ SDL_SCANCODE_UNDO => 122 ], # AC Undo
4597 [ SDL_SCANCODE_CUT => 123 ], # AC Cut
4598 [ SDL_SCANCODE_COPY => 124 ], # AC Copy
4599 [ SDL_SCANCODE_PASTE => 125 ], # AC Paste
4600 [ SDL_SCANCODE_FIND => 126 ], # AC Find
4601 [ SDL_SCANCODE_MUTE => 127 ], [ SDL_SCANCODE_VOLUMEUP => 128 ], [ SDL_SCANCODE_VOLUMEDOWN => 129 ],
4602
4603 # not sure whether there's a reason to enable these
4604 # [SDL_SCANCODE_LOCKINGCAPSLOCK => 130],
4605 # [SDL_SCANCODE_LOCKINGNUMLOCK => 131],
4606 # [SDL_SCANCODE_LOCKINGSCROLLLOCK => 132],
4607 [ SDL_SCANCODE_KP_COMMA => 133 ], [ SDL_SCANCODE_KP_EQUALSAS400 => 134 ],
4608 #
4609 [ SDL_SCANCODE_INTERNATIONAL1 => 135 ], # used on Asian keyboards, see footnotes in USB doc
4610 [ SDL_SCANCODE_INTERNATIONAL2 => 136 ], [ SDL_SCANCODE_INTERNATIONAL3 => 137 ], # Yen
4611 [ SDL_SCANCODE_INTERNATIONAL4 => 138 ], [ SDL_SCANCODE_INTERNATIONAL5 => 139 ], [ SDL_SCANCODE_INTERNATIONAL6 => 140 ],
4612 [ SDL_SCANCODE_INTERNATIONAL7 => 141 ], [ SDL_SCANCODE_INTERNATIONAL8 => 142 ], [ SDL_SCANCODE_INTERNATIONAL9 => 143 ],
4613 [ SDL_SCANCODE_LANG1 => 144 ], # Hangul/English toggle
4614 [ SDL_SCANCODE_LANG2 => 145 ], # Hanja conversion
4615 [ SDL_SCANCODE_LANG3 => 146 ], # Katakana
4616 [ SDL_SCANCODE_LANG4 => 147 ], # Hiragana
4617 [ SDL_SCANCODE_LANG5 => 148 ], # Zenkaku/Hankaku
4618 [ SDL_SCANCODE_LANG6 => 149 ], # reserved
4619 [ SDL_SCANCODE_LANG7 => 150 ], # reserved
4620 [ SDL_SCANCODE_LANG8 => 151 ], # reserved
4621 [ SDL_SCANCODE_LANG9 => 152 ], # reserved
4622
4623 #
4624 [ SDL_SCANCODE_ALTERASE => 153 ], # Erase-Eaze
4625 [ SDL_SCANCODE_SYSREQ => 154 ], [ SDL_SCANCODE_CANCEL => 155 ], # AC Cancel
4626 [ SDL_SCANCODE_CLEAR => 156 ], [ SDL_SCANCODE_PRIOR => 157 ], [ SDL_SCANCODE_RETURN2 => 158 ], [ SDL_SCANCODE_SEPARATOR => 159 ],
4627 [ SDL_SCANCODE_OUT => 160 ], [ SDL_SCANCODE_OPER => 161 ], [ SDL_SCANCODE_CLEARAGAIN => 162 ], [ SDL_SCANCODE_CRSEL => 163 ],
4628 [ SDL_SCANCODE_EXSEL => 164 ],
4629 #
4630 [ SDL_SCANCODE_KP_00 => 176 ], [ SDL_SCANCODE_KP_000 => 177 ], [ SDL_SCANCODE_THOUSANDSSEPARATOR => 178 ],
4631 [ SDL_SCANCODE_DECIMALSEPARATOR => 179 ], [ SDL_SCANCODE_CURRENCYUNIT => 180 ], [ SDL_SCANCODE_CURRENCYSUBUNIT => 181 ],
4632 [ SDL_SCANCODE_KP_LEFTPAREN => 182 ], [ SDL_SCANCODE_KP_RIGHTPAREN => 183 ], [ SDL_SCANCODE_KP_LEFTBRACE => 184 ],
4633 [ SDL_SCANCODE_KP_RIGHTBRACE => 185 ], [ SDL_SCANCODE_KP_TAB => 186 ], [ SDL_SCANCODE_KP_BACKSPACE => 187 ],
4634 [ SDL_SCANCODE_KP_A => 188 ], [ SDL_SCANCODE_KP_B => 189 ], [ SDL_SCANCODE_KP_C => 190 ], [ SDL_SCANCODE_KP_D => 191 ],
4635 [ SDL_SCANCODE_KP_E => 192 ], [ SDL_SCANCODE_KP_F => 193 ], [ SDL_SCANCODE_KP_XOR => 194 ], [ SDL_SCANCODE_KP_POWER => 195 ],
4636 [ SDL_SCANCODE_KP_PERCENT => 196 ], [ SDL_SCANCODE_KP_LESS => 197 ], [ SDL_SCANCODE_KP_GREATER => 198 ],
4637 [ SDL_SCANCODE_KP_AMPERSAND => 199 ], [ SDL_SCANCODE_KP_DBLAMPERSAND => 200 ], [ SDL_SCANCODE_KP_VERTICALBAR => 201 ],
4638 [ SDL_SCANCODE_KP_DBLVERTICALBAR => 202 ], [ SDL_SCANCODE_KP_COLON => 203 ], [ SDL_SCANCODE_KP_HASH => 204 ],
4639 [ SDL_SCANCODE_KP_SPACE => 205 ], [ SDL_SCANCODE_KP_AT => 206 ], [ SDL_SCANCODE_KP_EXCLAM => 207 ], [ SDL_SCANCODE_KP_MEMSTORE => 208 ],
4640 [ SDL_SCANCODE_KP_MEMRECALL => 209 ], [ SDL_SCANCODE_KP_MEMCLEAR => 210 ], [ SDL_SCANCODE_KP_MEMADD => 211 ],
4641 [ SDL_SCANCODE_KP_MEMSUBTRACT => 212 ], [ SDL_SCANCODE_KP_MEMMULTIPLY => 213 ], [ SDL_SCANCODE_KP_MEMDIVIDE => 214 ],
4642 [ SDL_SCANCODE_KP_PLUSMINUS => 215 ], [ SDL_SCANCODE_KP_CLEAR => 216 ], [ SDL_SCANCODE_KP_CLEARENTRY => 217 ],
4643 [ SDL_SCANCODE_KP_BINARY => 218 ], [ SDL_SCANCODE_KP_OCTAL => 219 ], [ SDL_SCANCODE_KP_DECIMAL => 220 ],
4644 [ SDL_SCANCODE_KP_HEXADECIMAL => 221 ],
4645 #
4646 [ SDL_SCANCODE_LCTRL => 224 ], [ SDL_SCANCODE_LSHIFT => 225 ], [ SDL_SCANCODE_LALT => 226 ], # alt, option
4647 [ SDL_SCANCODE_LGUI => 227 ], # windows, command (apple), meta
4648 [ SDL_SCANCODE_RCTRL => 228 ], [ SDL_SCANCODE_RSHIFT => 229 ], [ SDL_SCANCODE_RALT => 230 ], # alt gr, option
4649 [ SDL_SCANCODE_RGUI => 231 ], # windows, command (apple), meta
4650
4651 #
4652 [ SDL_SCANCODE_MODE => 257 ], # I'm not sure if this is really not covered by any of
4653
4654 # the above, but since there's a special SDL_KMOD_MODE for it I'm adding it here
4655 #
4656 # These values are mapped from usage page 0x0C (USB consumer page).
4657 #
4658 # There are way more keys in the spec than we can represent in the current scancode
4659 # range, so pick the ones that commonly come up in real world usage.
4660 [ SDL_SCANCODE_SLEEP => 258 ], # Sleep
4661 [ SDL_SCANCODE_WAKE => 259 ], # Wake
4662 [ SDL_SCANCODE_CHANNEL_INCREMENT => 260 ], # Channel Increment
4663 [ SDL_SCANCODE_CHANNEL_DECREMENT => 261 ], # Channel Decrement
4664 [ SDL_SCANCODE_MEDIA_PLAY => 262 ], # Play
4665 [ SDL_SCANCODE_MEDIA_PAUSE => 263 ], # Pause
4666 [ SDL_SCANCODE_MEDIA_RECORD => 264 ], # Record
4667 [ SDL_SCANCODE_MEDIA_FAST_FORWARD => 265 ], # Fast Forward
4668 [ SDL_SCANCODE_MEDIA_REWIND => 266 ], # Rewind
4669 [ SDL_SCANCODE_MEDIA_NEXT_TRACK => 267 ], # Next Track
4670 [ SDL_SCANCODE_MEDIA_PREVIOUS_TRACK => 268 ], # Previous Track
4671 [ SDL_SCANCODE_MEDIA_STOP => 269 ], # Stop
4672 [ SDL_SCANCODE_MEDIA_EJECT => 270 ], # Eject
4673 [ SDL_SCANCODE_MEDIA_PLAY_PAUSE => 271 ], # Play / Pause
4674 [ SDL_SCANCODE_MEDIA_SELECT => 272 ], # Media Select
4675 [ SDL_SCANCODE_AC_NEW => 273 ], # AC New
4676 [ SDL_SCANCODE_AC_OPEN => 274 ], # AC Open
4677 [ SDL_SCANCODE_AC_CLOSE => 275 ], # AC Close
4678 [ SDL_SCANCODE_AC_EXIT => 276 ], # AC Exit
4679 [ SDL_SCANCODE_AC_SAVE => 277 ], # AC Save
4680 [ SDL_SCANCODE_AC_PRINT => 278 ], # AC Print
4681 [ SDL_SCANCODE_AC_PROPERTIES => 279 ], # AC Properties
4682 [ SDL_SCANCODE_AC_SEARCH => 280 ], # AC Search
4683 [ SDL_SCANCODE_AC_HOME => 281 ], # AC Home
4684 [ SDL_SCANCODE_AC_BACK => 282 ], # AC Back
4685 [ SDL_SCANCODE_AC_FORWARD => 283 ], # AC Forward
4686 [ SDL_SCANCODE_AC_STOP => 284 ], # AC Stop
4687 [ SDL_SCANCODE_AC_REFRESH => 285 ], # AC Refresh
4688 [ SDL_SCANCODE_AC_BOOKMARKS => 286 ], # AC Bookmarks
4689
4690 # These are values that are often used on mobile phones.
4691 [ SDL_SCANCODE_SOFTLEFT => 287 ], # Usually situated below the display on phones and
4692
4693 # used as a multi-function feature key for selecting
4694 # a software defined function shown on the bottom left
4695 # of the display.
4696 [ SDL_SCANCODE_SOFTRIGHT => 288 ], # Usually situated below the display on phones and
4697
4698 # used as a multi-function feature key for selecting
4699 # a software defined function shown on the bottom right
4700 # of the display.
4701 [ SDL_SCANCODE_CALL => 289 ], # Used for accepting phone calls.
4702 [ SDL_SCANCODE_ENDCALL => 290 ], # Used for rejecting phone calls.
4703
4704 # Add any other keys here.
4705 [ SDL_SCANCODE_RESERVED => 400 ], # 400-500 reserved for dynamic keycodes
4706 [ SDL_SCANCODE_COUNT => 512 ] # not a key, just marks the number of scancodes for array bounds
4707 ];
4708 }
4709
4710 =head3 C<:sensor> - Sensors
4711
4712 SDL sensor management.
4713
4714 These APIs grant access to gyros and accelerometers on various platforms.
4715
4716 See L<SDL3: CategorySensor|https://wiki.libsdl.org/SDL3/CategorySensor>
4717
4718 =cut
4719
4720 sub _sensor() {
4721 state $done++ && return;
4722 _error();
4723 _properties();
4724 _stdinc();
4725 #
4726 _typedef_and_export SDL_Sensor => Void;
4727 _typedef_and_export SDL_SensorID => UInt32;
4728 _const_and_export SDL_STANDARD_GRAVITY => 9.80665;
4729 _enum_and_export SDL_SensorType => [
4730 [ SDL_SENSOR_INVALID => -1 ], 'SDL_SENSOR_UNKNOWN', 'SDL_SENSOR_ACCEL', 'SDL_SENSOR_GYRO',
4731 'SDL_SENSOR_ACCEL_L', 'SDL_SENSOR_GYRO_L', 'SDL_SENSOR_ACCEL_R', 'SDL_SENSOR_GYRO_R',
4732 'SDL_SENSOR_COUNT'
4733 ];
4734 _affix_and_export SDL_GetSensors => [ Pointer [Int] ], Pointer [ SDL_SensorID() ];
4735 _affix_and_export SDL_GetSensorNameForID => [ SDL_SensorID() ], String;
4736 _affix_and_export SDL_GetSensorTypeForID => [ SDL_SensorID() ], SDL_SensorType();
4737 _affix_and_export SDL_GetSensorNonPortableTypeForID => [ SDL_SensorID() ], Int;
4738 _affix_and_export SDL_OpenSensor => [ SDL_SensorID() ], Pointer [ SDL_Sensor() ];
4739 _affix_and_export SDL_GetSensorFromID => [ SDL_SensorID() ], Pointer [ SDL_Sensor() ];
4740 _affix_and_export SDL_GetSensorProperties => [ Pointer [ SDL_Sensor() ] ], SDL_PropertiesID();
4741 _affix_and_export SDL_GetSensorName => [ Pointer [ SDL_Sensor() ] ], String;
4742 _affix_and_export SDL_GetSensorType => [ Pointer [ SDL_Sensor() ] ], SDL_SensorType();
4743 _affix_and_export SDL_GetSensorNonPortableType => [ Pointer [ SDL_Sensor() ] ], Int;
4744 _affix_and_export SDL_GetSensorID => [ Pointer [ SDL_Sensor() ] ], SDL_SensorID();
4745 _affix_and_export SDL_GetSensorData => [ Pointer [ SDL_Sensor() ], Pointer [Float], Int ], Bool;
4746 _affix_and_export SDL_CloseSensor => [ Pointer [ SDL_Sensor() ] ], Void;
4747 _affix_and_export SDL_UpdateSensors => [], Void;
4748 }
4749
4750 =head3 C<:storage> - Storage Abstraction
4751
4752 The storage API is a high-level API designed to abstract away the portability issues that come up when using something
4753 lower-level.
4754
4755 See L<SDL3: CategoryStorage|https://wiki.libsdl.org/SDL3/CategoryStorage>
4756
4757 =cut
4758
4759 sub _storage() {
4760 state $done++ && return;
4761 _error();
4762 _filesystem();
4763 _properties();
4764 _stdinc();
4765 #
4766 _typedef_and_export SDL_Storage => Void;
4767 _typedef_and_export SDL_StorageInterface => Struct [
4768 version => UInt32,
4769 close => Callback [ [ Pointer [Void] ] => Bool ],
4770 ready => Callback [ [ Pointer [Void] ] => Bool ],
4771 enumerate => Callback [ [ Pointer [Void], String, SDL_EnumerateDirectoryCallback(), Pointer [Void] ] => Bool ],
4772 info => Callback [ [ Pointer [Void], String, Pointer [ SDL_PathInfo() ] ] => Bool ],
4773 read_file => Callback [ [ Pointer [Void], String, Pointer [Void], UInt64 ] => Bool ],
4774 write_file => Callback [ [ Pointer [Void], String, Pointer [Void], UInt64 ] => Bool ],
4775 mkdir => Callback [ [ Pointer [Void], String ] => Bool ],
4776 remove => Callback [ [ Pointer [Void], String ] => Bool ],
4777 rename => Callback [ [ Pointer [Void], String, String ] => Bool ],
4778 copy => Callback [ [ Pointer [Void], String, String ] => Bool ],
4779 space_remaining => Callback [ [ Pointer [Void] ] => UInt64 ]
4780 ];
4781 _affix_and_export SDL_OpenTitleStorage => [ String, SDL_PropertiesID() ], Pointer [ SDL_Storage() ];
4782 _affix_and_export SDL_OpenUserStorage => [ String, String, SDL_PropertiesID() ], Pointer [ SDL_Storage() ];
4783 _affix_and_export SDL_OpenFileStorage => [String], Pointer [ SDL_Storage() ];
4784 _affix_and_export SDL_OpenStorage => [ Pointer [ SDL_StorageInterface() ], Pointer [Void] ], Pointer [ SDL_Storage() ];
4785 _affix_and_export SDL_CloseStorage => [ Pointer [ SDL_Storage() ] ], Bool;
4786 _affix_and_export SDL_StorageReady => [ Pointer [ SDL_Storage() ] ], Bool;
4787 _affix_and_export SDL_GetStorageFileSize => [ Pointer [ SDL_Storage() ], String, Pointer [UInt64] ], Bool;
4788 _affix_and_export SDL_ReadStorageFile => [ Pointer [ SDL_Storage() ], String, Pointer [Void], UInt64 ], Bool;
4789 _affix_and_export SDL_WriteStorageFile => [ Pointer [ SDL_Storage() ], String, Pointer [Void], UInt64 ], Bool;
4790 _affix_and_export SDL_CreateStorageDirectory => [ Pointer [ SDL_Storage() ], String ], Bool;
4791 _affix_and_export
4792 SDL_EnumerateStorageDirectory => [ Pointer [ SDL_Storage() ], String, SDL_EnumerateDirectoryCallback(), Pointer [Void] ],
4793 Bool;
4794 _affix_and_export SDL_RemoveStoragePath => [ Pointer [ SDL_Storage() ], String ], Bool;
4795 _affix_and_export SDL_RenameStoragePath => [ Pointer [ SDL_Storage() ], String, String ], Bool;
4796 _affix_and_export SDL_CopyStorageFile => [ Pointer [ SDL_Storage() ], String, String ], Bool;
4797 _affix_and_export SDL_GetStoragePathInfo => [ Pointer [ SDL_Storage() ], String, Pointer [ SDL_PathInfo() ] ], Bool;
4798 _affix_and_export SDL_GetStorageSpaceRemaining => [ Pointer [ SDL_Storage() ] ], UInt64;
4799 _affix_and_export
4800 SDL_GlobStorageDirectory => [ Pointer [ SDL_Storage() ], String, String, SDL_GlobFlags(), Pointer [Int] ],
4801 Pointer [String];
4802 }
4803
4804 =head3 C<:surface> - Surface Creation and Simple Drawing
4805
4806 SDL surfaces are buffers of pixels in system RAM. These are useful for passing around and manipulating images that are
4807 not stored in GPU memory.
4808
4809 See L<SDL3: CategorySurface|https://wiki.libsdl.org/SDL3/CategorySurface>
4810
4811 =cut
4812
4813 sub _surface() {
4814 state $done++ && return;
4815 _blendmode();
4816 _error();
4817 _iostream();
4818 _pixels();
4819 _properties();
4820 _rect();
4821 _stdinc();
4822 #
4823 _typedef_and_export SDL_SurfaceFlags => UInt32;
4824 _const_and_export SDL_SURFACE_PREALLOCATED => 0x00000001;
4825 _const_and_export SDL_SURFACE_LOCK_NEEDED => 0x00000002;
4826 _const_and_export SDL_SURFACE_LOCKED => 0x00000004;
4827 _const_and_export SDL_SURFACE_SIMD_ALIGNED => 0x00000008;
4828 _func_and_export( SDL_MUSTLOCK => sub ($S) { ( ( ($S)->flags & SDL_SURFACE_LOCK_NEEDED() ) == SDL_SURFACE_LOCK_NEEDED() ) } );
4829 _enum_and_export SDL_ScaleMode =>
4830 [ [ SDL_SCALEMODE_INVALID => -1 ], 'SDL_SCALEMODE_NEAREST', 'SDL_SCALEMODE_LINEAR', 'SDL_SCALEMODE_PIXELART' ];
4831 _enum_and_export SDL_FlipMode => [
4832 'SDL_FLIP_NONE', 'SDL_FLIP_HORIZONTAL',
4833 'SDL_FLIP_VERTICAL', [ SDL_FLIP_HORIZONTAL_AND_VERTICAL => ('SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL') ]
4834 ];
4835 _typedef_and_export SDL_Surface => Struct [
4836 flags => SDL_SurfaceFlags(),
4837 format => SDL_PixelFormat(),
4838 w => Int,
4839 h => Int,
4840 pitch => Int,
4841 pixels => Pointer [Void],
4842 refcount => Int,
4843 reserved => Pointer [Void]
4844 ];
4845 _affix_and_export SDL_CreateSurface => [ Int, Int, SDL_PixelFormat() ], Pointer [ SDL_Surface() ];
4846 _affix_and_export SDL_CreateSurfaceFrom => [ Int, Int, SDL_PixelFormat(), Pointer [Void], Int ], Pointer [ SDL_Surface() ];
4847 _affix_and_export SDL_DestroySurface => [ Pointer [ SDL_Surface() ] ], Void;
4848 _affix_and_export SDL_GetSurfaceProperties => [ Pointer [ SDL_Surface() ] ], SDL_PropertiesID();
4849 _const_and_export SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT => 'SDL.surface.SDR_white_point';
4850 _const_and_export SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT => 'SDL.surface.HDR_headroom';
4851 _const_and_export SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING => 'SDL.surface.tonemap';
4852 _const_and_export SDL_PROP_SURFACE_HOTSPOT_X_NUMBER => 'SDL.surface.hotspot.x';
4853 _const_and_export SDL_PROP_SURFACE_HOTSPOT_Y_NUMBER => 'SDL.surface.hotspot.y';
4854 _affix_and_export SDL_SetSurfaceColorspace => [ Pointer [ SDL_Surface() ], SDL_Colorspace() ], Bool;
4855 _affix_and_export SDL_GetSurfaceColorspace => [ Pointer [ SDL_Surface() ] ], SDL_Colorspace();
4856 _affix_and_export SDL_CreateSurfacePalette => [ Pointer [ SDL_Surface() ] ], Pointer [ SDL_Palette() ];
4857 _affix_and_export SDL_SetSurfacePalette => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Palette() ] ], Bool;
4858 _affix_and_export SDL_GetSurfacePalette => [ Pointer [ SDL_Surface() ] ], Pointer [ SDL_Palette() ];
4859 _affix_and_export SDL_AddSurfaceAlternateImage => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Surface() ] ], Bool;
4860 _affix_and_export SDL_SurfaceHasAlternateImages => [ Pointer [ SDL_Surface() ] ], Bool;
4861 _affix_and_export SDL_GetSurfaceImages => [ Pointer [ SDL_Surface() ], Pointer [Int] ], Pointer [ Pointer [ SDL_Surface() ] ];
4862 _affix_and_export SDL_RemoveSurfaceAlternateImages => [ Pointer [ SDL_Surface() ] ], Void;
4863 _affix_and_export SDL_LockSurface => [ Pointer [ SDL_Surface() ] ], Bool;
4864 _affix_and_export SDL_UnlockSurface => [ Pointer [ SDL_Surface() ] ], Void;
4865
4866 #~ _affix_and_export SDL_LoadSurface_IO => [ Pointer [ SDL_IOStream() ], Bool ], Pointer [ SDL_Surface() ];
4867 #_affix_and_export SDL_LoadSurface => [String], Pointer [ SDL_Surface() ];
4868 #~ _affix_and_export SDL_LoadBMP_IO => [ Pointer [ SDL_IOStream() ], Bool ], Pointer [ SDL_Surface() ];
4869 #~ _affix_and_export SDL_LoadBMP => [String], Pointer [ SDL_Surface() ];
4870 #~ _affix_and_export SDL_SaveBMP_IO => [ Pointer [ SDL_Surface() ], Pointer [ SDL_IOStream() ], Bool ], Bool;
4871 #~ _affix_and_export SDL_SaveBMP => [ Pointer [ SDL_Surface() ], String ], Bool;
4872 #~ _affix_and_export SDL_LoadPNG_IO => [ Pointer [ SDL_IOStream() ], Bool ], Pointer [ SDL_Surface() ];
4873 #~ _affix_and_export SDL_LoadPNG => [String], Pointer [ SDL_Surface() ]
4874 #~ _affix_and_export SDL_SavePNG_IO => [ Pointer [ SDL_Surface() ], Pointer [ SDL_IOStream() ], Bool ], Bool;
4875 #~ _affix_and_export SDL_SavePNG => [ Pointer [ SDL_Surface() ], String ], Bool;
4876 _affix_and_export SDL_SetSurfaceRLE => [ Pointer [ SDL_Surface() ], Bool ], Bool;
4877 _affix_and_export SDL_SurfaceHasRLE => [ Pointer [ SDL_Surface() ] ], Bool;
4878 _affix_and_export SDL_SetSurfaceColorKey => [ Pointer [ SDL_Surface() ], Bool, UInt32 ], Bool;
4879 _affix_and_export SDL_SurfaceHasColorKey => [ Pointer [ SDL_Surface() ] ], Bool;
4880 _affix_and_export SDL_GetSurfaceColorKey => [ Pointer [ SDL_Surface() ], Pointer [UInt32] ], Bool;
4881 _affix_and_export SDL_SetSurfaceColorMod => [ Pointer [ SDL_Surface() ], UInt8, UInt8, UInt8 ], Bool;
4882 _affix_and_export
4883 SDL_GetSurfaceColorMod => [ Pointer [ SDL_Surface() ], Pointer [UInt8], Pointer [UInt8], Pointer [UInt8] ],
4884 Bool;
4885 _affix_and_export SDL_SetSurfaceAlphaMod => [ Pointer [ SDL_Surface() ], UInt8 ], Bool;
4886 _affix_and_export SDL_GetSurfaceAlphaMod => [ Pointer [ SDL_Surface() ], Pointer [UInt8] ], Bool;
4887 _affix_and_export SDL_SetSurfaceBlendMode => [ Pointer [ SDL_Surface() ], SDL_BlendMode() ], Bool;
4888 _affix_and_export SDL_GetSurfaceBlendMode => [ Pointer [ SDL_Surface() ], Pointer [ SDL_BlendMode() ] ], Bool;
4889 _affix_and_export SDL_SetSurfaceClipRect => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ] ], Bool;
4890 _affix_and_export SDL_GetSurfaceClipRect => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ] ], Bool;
4891 _affix_and_export SDL_FlipSurface => [ Pointer [ SDL_Surface() ], SDL_FlipMode() ], Bool;
4892
4893 #~ _affix_and_export SDL_RotateSurface => [ Pointer [ SDL_Surface() ], Float ], Pointer [ SDL_Surface() ];
4894 _affix_and_export SDL_DuplicateSurface => [ Pointer [ SDL_Surface() ] ], Pointer [ SDL_Surface() ];
4895 _affix_and_export SDL_ScaleSurface => [ Pointer [ SDL_Surface() ], Int, Int, SDL_ScaleMode() ], Pointer [ SDL_Surface() ];
4896 _affix_and_export SDL_ConvertSurface => [ Pointer [ SDL_Surface() ], SDL_PixelFormat() ], Pointer [ SDL_Surface() ];
4897 _affix_and_export
4898 SDL_ConvertSurfaceAndColorspace =>
4899 [ Pointer [ SDL_Surface() ], SDL_PixelFormat(), Pointer [ SDL_Palette() ], SDL_Colorspace(), SDL_PropertiesID() ],
4900 Pointer [ SDL_Surface() ];
4901 _affix_and_export
4902 SDL_ConvertPixels => [ Int, Int, SDL_PixelFormat(), Pointer [Void], Int, SDL_PixelFormat(), Pointer [Void], Int ],
4903 Bool;
4904 _affix_and_export
4905 SDL_ConvertPixelsAndColorspace => [
4906 Int, Int, SDL_PixelFormat(), SDL_Colorspace(), SDL_PropertiesID(), Pointer [Void],
4907 Int, SDL_PixelFormat(), SDL_Colorspace(), SDL_PropertiesID(), Pointer [Void], Int
4908 ],
4909 Bool;
4910 _affix_and_export
4911 SDL_PremultiplyAlpha => [ Int, Int, SDL_PixelFormat(), Pointer [Void], Int, SDL_PixelFormat(), Pointer [Void], Int, Bool ],
4912 Bool;
4913 _affix_and_export SDL_PremultiplySurfaceAlpha => [ Pointer [ SDL_Surface() ], Bool ], Bool;
4914 _affix_and_export SDL_ClearSurface => [ Pointer [ SDL_Surface() ], Float, Float, Float, Float ], Bool;
4915 _affix_and_export SDL_FillSurfaceRect => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], UInt32 ], Bool;
4916 _affix_and_export SDL_FillSurfaceRects => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Int, UInt32 ], Bool;
4917 _affix_and_export
4918 SDL_BlitSurface => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ] ],
4919 Bool;
4920 _affix_and_export
4921 SDL_BlitSurfaceUnchecked => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ] ],
4922 Bool;
4923 _affix_and_export
4924 SDL_BlitSurfaceScaled =>
4925 [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], SDL_ScaleMode() ],
4926 Bool;
4927 _affix_and_export
4928 SDL_BlitSurfaceUncheckedScaled =>
4929 [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], SDL_ScaleMode() ],
4930 Bool;
4931 _affix_and_export
4932 SDL_StretchSurface =>
4933 [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], SDL_ScaleMode() ],
4934 Bool;
4935 _affix_and_export
4936 SDL_BlitSurfaceTiled => [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ] ],
4937 Bool;
4938 _affix_and_export
4939 SDL_BlitSurfaceTiledWithScale =>
4940 [ Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ], Float, SDL_ScaleMode(), Pointer [ SDL_Surface() ], Pointer [ SDL_Rect() ] ],
4941 Bool;
4942 _affix_and_export
4943 SDL_BlitSurface9Grid => [
4944 Pointer [ SDL_Surface() ],
4945 Pointer [ SDL_Rect() ],
4946 Int, Int, Int, Int, Float, SDL_ScaleMode(),
4947 Pointer [ SDL_Surface() ],
4948 Pointer [ SDL_Rect() ]
4949 ],
4950 Bool;
4951 _affix_and_export SDL_MapSurfaceRGB => [ Pointer [ SDL_Surface() ], UInt8, UInt8, UInt8 ], UInt32;
4952 _affix_and_export SDL_MapSurfaceRGBA => [ Pointer [ SDL_Surface() ], UInt8, UInt8, UInt8, UInt8 ], UInt32;
4953 _affix_and_export
4954 SDL_ReadSurfacePixel => [ Pointer [ SDL_Surface() ], Int, Int, Pointer [UInt8], Pointer [UInt8], Pointer [UInt8], Pointer [UInt8] ],
4955 Bool;
4956 _affix_and_export
4957 SDL_ReadSurfacePixelFloat => [ Pointer [ SDL_Surface() ], Int, Int, Pointer [Float], Pointer [Float], Pointer [Float], Pointer [Float] ],
4958 Bool;
4959 _affix_and_export SDL_WriteSurfacePixel => [ Pointer [ SDL_Surface() ], Int, Int, UInt8, UInt8, UInt8, UInt8 ], Bool;
4960 _affix_and_export SDL_WriteSurfacePixelFloat => [ Pointer [ SDL_Surface() ], Int, Int, Float, Float, Float, Float ], Bool;
4961 }
4962
4963 =head3 C<:stdinc> - Standard Library Functionality
4964
4965 SDL provides its own implementation of some of the most important C runtime functions. Using these functions allows an
4966 app to have access to common C functionality without depending on a specific C runtime (or a C runtime at all).
4967
4968 See L<SDL3: CategoryStdinc|https://wiki.libsdl.org/SDL3/CategoryStdinc>
4969
4970 =cut
4971
4972 sub _stdinc() {
4973 state $done++ && return;
4974 _error();
4975 #
4976 _affix_and_export SDL_malloc => [Size_t], Pointer [Void];
4977 _affix_and_export SDL_calloc => [ Size_t, Size_t ], Pointer [Void];
4978 _affix_and_export SDL_realloc => [ Pointer [Void], Size_t ], Pointer [Void];
4979 _affix_and_export SDL_free => [ Pointer [Void] ], Void;
4980 _typedef_and_export SDL_malloc_func => Callback [ [Size_t] => Pointer [Void] ];
4981 _typedef_and_export SDL_calloc_func => Callback [ [ Size_t, Size_t ] => Pointer [Void] ];
4982 _typedef_and_export SDL_realloc_func => Callback [ [ Pointer [Void], Size_t ] => Pointer [Void] ];
4983 _typedef_and_export SDL_free_func => Callback [ [ Pointer [Void] ] => Void ];
4984 _affix_and_export
4985 SDL_GetOriginalMemoryFunctions =>
4986 [ Pointer [ SDL_malloc_func() ], Pointer [ SDL_calloc_func() ], Pointer [ SDL_realloc_func() ], Pointer [ SDL_free_func() ] ],
4987 Void;
4988 _affix_and_export
4989 SDL_GetMemoryFunctions =>
4990 [ Pointer [ SDL_malloc_func() ], Pointer [ SDL_calloc_func() ], Pointer [ SDL_realloc_func() ], Pointer [ SDL_free_func() ] ],
4991 Void;
4992 _affix_and_export
4993 SDL_SetMemoryFunctions =>
4994 [ Pointer [ SDL_malloc_func() ], Pointer [ SDL_calloc_func() ], Pointer [ SDL_realloc_func() ], Pointer [ SDL_free_func() ] ],
4995 Void;
4996 _affix_and_export SDL_aligned_alloc => [ Size_t, Size_t ], Pointer [Void];
4997 _affix_and_export SDL_aligned_free => [ Pointer [Void] ], Void;
4998 _affix_and_export SDL_GetNumAllocations => [], Int;
4999 _typedef_and_export SDL_Environment => Pointer [Void];
5000 _affix_and_export SDL_GetEnvironment => [], SDL_Environment();
5001 _affix_and_export
5002 SDL_CreateEnvironment => [Bool],
5003 SDL_Environment();
5004 _affix_and_export SDL_GetEnvironmentVariable => [ SDL_Environment(), String ], String;
5005 _affix_and_export SDL_GetEnvironmentVariables => [ SDL_Environment() ], Pointer [String];
5006 _affix_and_export SDL_SetEnvironmentVariable => [ SDL_Environment(), String, String, Bool ], Bool;
5007 _affix_and_export SDL_UnsetEnvironmentVariable => [ SDL_Environment(), String ], Bool;
5008 _affix_and_export SDL_DestroyEnvironment => [ SDL_Environment() ], Void;
5009 _affix_and_export SDL_getenv => [String], String;
5010 _affix_and_export SDL_getenv_unsafe => [String], String;
5011 _affix_and_export SDL_setenv_unsafe => [ String, String, Int ], Int;
5012 _affix_and_export SDL_unsetenv_unsafe => [String], Int;
5013 _typedef_and_export SDL_CompareCallback => Callback [ [ Pointer [Void], Pointer [Void] ] => Int ];
5014 _affix_and_export SDL_qsort => [ Pointer [Void], Size_t, Size_t, SDL_CompareCallback() ], Void;
5015 _affix_and_export SDL_bsearch => [ Pointer [Void], Pointer [Void], Size_t, Size_t, SDL_CompareCallback() ], Pointer [Void];
5016 _typedef_and_export SDL_CompareCallback_r => Callback [ [ Pointer [Void], Pointer [Void], Pointer [Void] ] => Int ];
5017 _affix_and_export SDL_qsort_r => [ Pointer [Void], Size_t, Size_t, SDL_CompareCallback_r(), Pointer [Void] ], Void;
5018 _affix_and_export
5019 SDL_bsearch_r => [ Pointer [Void], Pointer [Void], Size_t, Size_t, SDL_CompareCallback_r(), Pointer [Void] ],
5020 Pointer [Void];
5021 _affix_and_export SDL_abs => [Int], Int;
5022 _func_and_export SDL_min => sub ( $x, $y ) { ( ( ($x) < ($y) ) ? ($x) : ($y) ) };
5023 _func_and_export SDL_max => sub ( $x, $y ) { ( ( ($x) > ($y) ) ? ($x) : ($y) ) };
5024 _func_and_export SDL_clamp => sub ( $x, $a, $b ) { ( ( ($x) < ($a) ) ? ($a) : ( ( ($x) > ($b) ) ? ($b) : ($x) ) ) };
5025 _affix_and_export SDL_isalpha => [Int], Int;
5026 _affix_and_export SDL_isalnum => [Int], Int;
5027 _affix_and_export SDL_isblank => [Int], Int;
5028 _affix_and_export SDL_iscntrl => [Int], Int;
5029 _affix_and_export SDL_isdigit => [Int], Int;
5030 _affix_and_export SDL_isxdigit => [Int], Int;
5031 _affix_and_export SDL_ispunct => [Int], Int;
5032 _affix_and_export SDL_isspace => [Int], Int;
5033 _affix_and_export SDL_isupper => [Int], Int;
5034 _affix_and_export SDL_islower => [Int], Int;
5035 _affix_and_export SDL_isprint => [Int], Int;
5036 _affix_and_export SDL_isgraph => [Int], Int;
5037 _affix_and_export SDL_toupper => [Int], Int;
5038 _affix_and_export SDL_tolower => [Int], Int;
5039 _affix_and_export SDL_crc16 => [ UInt16, Pointer [Void], Size_t ], UInt16;
5040 _affix_and_export SDL_crc32 => [ UInt32, Pointer [Void], Size_t ], UInt32;
5041 _affix_and_export SDL_murmur3_32 => [ Pointer [Void], Size_t, UInt32 ], UInt32;
5042 _affix_and_export SDL_memcpy => [ Pointer [Void], Pointer [Void], Size_t ], Pointer [Void];
5043 _affix_and_export SDL_memmove => [ Pointer [Void], Pointer [Void], Size_t ], Pointer [Void];
5044 _affix_and_export SDL_memset => [ Pointer [Void], Int, Size_t ], Pointer [Void];
5045 _affix_and_export SDL_memset4 => [ Pointer [Void], UInt32, Size_t ], Pointer [Void];
5046 _affix_and_export SDL_memcmp => [ Pointer [Void], Pointer [Void], Size_t ], Int;
5047 _affix_and_export SDL_wcslen => [ Pointer [WChar] ], Size_t;
5048 _affix_and_export SDL_wcsnlen => [ Pointer [WChar], Size_t ], Size_t;
5049 _affix_and_export SDL_wcslcpy => [ Pointer [WChar], WString, Size_t ], Size_t;
5050 _affix_and_export SDL_wcslcat => [ Pointer [WChar], WString, Size_t ], Size_t;
5051 _affix_and_export SDL_wcsdup => [WString], WString;
5052 _affix_and_export SDL_wcsstr => [ WString, WString ], WString;
5053 _affix_and_export SDL_wcsnstr => [ WString, WString, Size_t ], WString;
5054 _affix_and_export SDL_wcscmp => [ WString, WString ], Int;
5055 _affix_and_export SDL_wcsncmp => [ WString, WString, Size_t ], Int;
5056 _affix_and_export SDL_wcscasecmp => [ WString, WString ], Int;
5057 _affix_and_export SDL_wcsncasecmp => [ WString, WString, Size_t ], Int;
5058 _affix_and_export SDL_wcstol => [ WString, Pointer [ Pointer [WChar] ], Int ], Long;
5059 _affix_and_export SDL_strlen => [String], Size_t;
5060 _affix_and_export SDL_strnlen => [ String, Size_t ], Size_t;
5061 _affix_and_export SDL_strlcpy => [ Pointer [UInt8], String, Size_t ], Size_t;
5062 _affix_and_export SDL_utf8strlcpy => [ Pointer [UInt8], String, Size_t ], Size_t;
5063 _affix_and_export SDL_strlcat => [ Pointer [UInt8], String, Size_t ], Size_t;
5064 _affix_and_export SDL_strdup => [String], String;
5065 _affix_and_export SDL_strndup => [ String, Size_t ], String;
5066 _affix_and_export SDL_strrev => [ Pointer [UInt8] ], String;
5067 _affix_and_export SDL_strupr => [ Pointer [UInt8] ], String;
5068 _affix_and_export SDL_strlwr => [ Pointer [UInt8] ], String;
5069 _affix_and_export SDL_strchr => [ String, Int ], String;
5070 _affix_and_export SDL_strrchr => [ String, Int ], String;
5071 _affix_and_export SDL_strstr => [ String, String ], String;
5072 _affix_and_export SDL_strnstr => [ String, String, Size_t ], String;
5073 _affix_and_export SDL_strcasestr => [ String, String ], String;
5074 _affix_and_export SDL_strtok_r => [ Pointer [UInt8], String, Pointer [ Pointer [UInt8] ] ], String;
5075 _affix_and_export SDL_utf8strlen => [String], Size_t;
5076 _affix_and_export SDL_utf8strnlen => [ String, Size_t ], Size_t;
5077 _affix_and_export SDL_itoa => [ Int, Pointer [UInt8], Int ], String;
5078 _affix_and_export SDL_uitoa => [ UInt, Pointer [UInt8], Int ], String;
5079 _affix_and_export SDL_ltoa => [ Long, Pointer [UInt8], Int ], String;
5080 _affix_and_export SDL_ultoa => [ ULong, Pointer [UInt8], Int ], String;
5081 _affix_and_export SDL_lltoa => [ LongLong, Pointer [UInt8], Int ], String;
5082 _affix_and_export SDL_ulltoa => [ ULongLong, Pointer [UInt8], Int ], String;
5083 _affix_and_export SDL_atoi => [String], Int;
5084 _affix_and_export SDL_atof => [String], Double;
5085 _affix_and_export SDL_strtol => [ String, Pointer [ Pointer [UInt8] ], Int ], Long;
5086 _affix_and_export SDL_strtoul => [ String, Pointer [ Pointer [UInt8] ], Int ], ULong;
5087 _affix_and_export SDL_strtoll => [ String, Pointer [ Pointer [UInt8] ], Int ], LongLong;
5088 _affix_and_export SDL_strtoull => [ String, Pointer [ Pointer [UInt8] ], Int ], ULongLong;
5089 _affix_and_export SDL_strtod => [ String, Pointer [ Pointer [UInt8] ] ], Double;
5090 _affix_and_export SDL_strcmp => [ String, String ], Int;
5091 _affix_and_export SDL_strncmp => [ String, String, Size_t ], Int;
5092 _affix_and_export SDL_strcasecmp => [ String, String ], Int;
5093 _affix_and_export SDL_strncasecmp => [ String, String, Size_t ], Int;
5094 _affix_and_export SDL_strpbrk => [ String, String ], String;
5095 _const_and_export SDL_INVALID_UNICODE_CODEPOINT => 0xFFFD;
5096 _affix_and_export SDL_StepUTF8 => [ Pointer [String], Pointer [Size_t] ], UInt32;
5097 _affix_and_export SDL_StepBackUTF8 => [ String, Pointer [String] ], UInt32;
5098 _affix_and_export SDL_UCS4ToUTF8 => [ UInt32, Pointer [UInt8] ], String;
5099
5100 #~ _affix_and_export SDL_sscanf => [ String, String, VarArgs ], Int;
5101 _affix_and_export SDL_vsscanf => [ String, String, Pointer [Void] ], Int;
5102
5103 #~ _affix_and_export SDL_snprintf => [ Pointer [UInt8], Size_t, String, VarArgs ], Int;
5104 #~ _affix_and_export SDL_swprintf => [ Pointer [WChar], Size_t, WString, VarArgs ], Int;
5105 _affix_and_export SDL_vsnprintf => [ Pointer [UInt8], Size_t, String, Pointer [Void] ], Int;
5106 _affix_and_export SDL_vswprintf => [ Pointer [WChar], Size_t, WString, Pointer [Void] ], Int;
5107
5108 #~ _affix_and_export SDL_asprintf => [ Pointer [ Pointer [UInt8] ], String, VarArgs ], Int;
5109 _affix_and_export SDL_vasprintf => [ Pointer [ Pointer [UInt8] ], String, Pointer [Void] ], Int;
5110 _affix_and_export SDL_srand => [UInt64], Void;
5111 _affix_and_export SDL_rand => [SInt32], SInt32;
5112 _affix_and_export SDL_randf => [], Float;
5113 _affix_and_export SDL_rand_bits => [], UInt32;
5114 _affix_and_export SDL_rand_r => [ Pointer [UInt64], SInt32 ], SInt32;
5115 _affix_and_export SDL_randf_r => [ Pointer [UInt64] ], Float;
5116 _affix_and_export SDL_rand_bits_r => [ Pointer [UInt64] ], UInt32;
5117 _const_and_export SDL_PI_D => 3.141592653589793238462643383279502884;
5118 _const_and_export SDL_PI_F => 3.141592653589793238462643383279502884;
5119 _affix_and_export SDL_acos => [Double], Double;
5120 _affix_and_export SDL_acosf => [Float], Float;
5121 _affix_and_export SDL_asin => [Double], Double;
5122 _affix_and_export SDL_asinf => [Float], Float;
5123 _affix_and_export SDL_atan => [Double], Double;
5124 _affix_and_export SDL_atanf => [Float], Float;
5125 _affix_and_export SDL_atan2 => [ Double, Double ], Double;
5126 _affix_and_export SDL_atan2f => [ Float, Float ], Float;
5127 _affix_and_export SDL_ceil => [Double], Double;
5128 _affix_and_export SDL_ceilf => [Float], Float;
5129 _affix_and_export SDL_copysign => [ Double, Double ], Double;
5130 _affix_and_export SDL_copysignf => [ Float, Float ], Float;
5131 _affix_and_export SDL_cos => [Double], Double;
5132 _affix_and_export SDL_cosf => [Float], Float;
5133 _affix_and_export SDL_exp => [Double], Double;
5134 _affix_and_export SDL_expf => [Float], Float;
5135 _affix_and_export SDL_fabs => [Double], Double;
5136 _affix_and_export SDL_fabsf => [Float], Float;
5137 _affix_and_export SDL_floor => [Double], Double;
5138 _affix_and_export SDL_floorf => [Float], Float;
5139 _affix_and_export SDL_trunc => [Double], Double;
5140 _affix_and_export SDL_truncf => [Float], Float;
5141 _affix_and_export SDL_fmod => [ Double, Double ], Double;
5142 _affix_and_export SDL_fmodf => [ Float, Float ], Float;
5143 _affix_and_export SDL_isinf => [Double], Int;
5144 _affix_and_export SDL_isinff => [Float], Int;
5145 _affix_and_export SDL_isnan => [Double], Int;
5146 _affix_and_export SDL_isnanf => [Float], Int;
5147 _affix_and_export SDL_log => [Double], Double;
5148 _affix_and_export SDL_logf => [Float], Float;
5149 _affix_and_export SDL_log10 => [Double], Double;
5150 _affix_and_export SDL_log10f => [Float], Float;
5151 _affix_and_export SDL_modf => [ Double, Pointer [Double] ], Double;
5152 _affix_and_export SDL_modff => [ Float, Pointer [Float] ], Float;
5153 _affix_and_export SDL_pow => [ Double, Double ], Double;
5154 _affix_and_export SDL_powf => [ Float, Float ], Float;
5155 _affix_and_export SDL_round => [Double], Double;
5156 _affix_and_export SDL_roundf => [Float], Float;
5157 _affix_and_export SDL_lround => [Double], Long;
5158 _affix_and_export SDL_lroundf => [Float], Long;
5159 _affix_and_export SDL_scalbn => [ Double, Int ], Double;
5160 _affix_and_export SDL_scalbnf => [ Float, Int ], Float;
5161 _affix_and_export SDL_sin => [Double], Double;
5162 _affix_and_export SDL_sinf => [Float], Float;
5163 _affix_and_export SDL_sqrt => [Double], Double;
5164 _affix_and_export SDL_sqrtf => [Float], Float;
5165 _affix_and_export SDL_tan => [Double], Double;
5166 _affix_and_export SDL_tanf => [Float], Float;
5167 _typedef_and_export SDL_iconv_t => Pointer [Void];
5168 _affix_and_export SDL_iconv_open => [ String, String ], SDL_iconv_t();
5169 _affix_and_export SDL_iconv_close => [ SDL_iconv_t() ], Int;
5170 _affix_and_export
5171 SDL_iconv => [ SDL_iconv_t(), Pointer [ Pointer [UInt8] ], Pointer [Size_t], Pointer [ Pointer [UInt8] ], Pointer [Size_t] ],
5172 Size_t;
5173 _const_and_export SDL_ICONV_ERROR => -1;
5174 _const_and_export SDL_ICONV_E2BIG => -2;
5175 _const_and_export SDL_ICONV_EILSEQ => -3;
5176 _const_and_export SDL_ICONV_EINVAL => -4;
5177 #
5178 _affix_and_export SDL_iconv_string => [ String, String, String, Size_t ], Pointer [UInt8];
5179 _func_and_export SDL_iconv_utf8_locale => sub ($S) { SDL_iconv_string( '', 'UTF-8', $S, SDL_strlen($S) + 1 ) };
5180 _func_and_export SDL_iconv_utf8_ucs2 => sub ($S) { SDL_iconv_string( 'UCS-2', 'UTF-8', $S, SDL_strlen($S) + 1 ) };
5181 _func_and_export SDL_iconv_utf8_ucs4 => sub ($S) { SDL_iconv_string( 'UCS-4', 'UTF-8', $S, SDL_strlen($S) + 1 ) };
5182 _func_and_export SDL_iconv_wchar_utf8 => sub ($S) { SDL_iconv_string( 'UTF-8', 'WCHAR_T', $S, ( SDL_wcslen($S) + 1 ) * length( pack 'P' ) ) };
5183 #
5184 my $max_size_t = ( 2**( $Config{ptrsize} * 8 ) ) - 1;
5185 _func_and_export SDL_size_mul_check_overflow => sub ( $a, $b, $ret ) {
5186 return 0 if ( $a != 0 && $b > $max_size_t / $a );
5187 $$ret = $a * $b;
5188 return 1;
5189 };
5190 _func_and_export SDL_size_add_check_overflow => sub ( $a, $b, $ret ) {
5191 return 0 if ( $b > $max_size_t - $a );
5192 $$ret = $a + $b;
5193 return 1;
5194 };
5195 #
5196 _typedef_and_export SDL_FunctionPointer => Callback [ [] => Void ];
5197 }
5198
5199 =head3 C<:system> - Platform-specific Functionality
5200
5201 Platform-specific SDL API functions. These are functions that deal with needs of specific operating systems, that
5202 didn't make sense to offer as platform-independent, generic APIs.
5203
5204 Most apps can make do without these functions, but they can be useful for integrating with other parts of a specific
5205 system, adding platform-specific polish to an app, or solving problems that only affect one target.
5206
5207 See L<SDL3: CategorySystem|https://wiki.libsdl.org/SDL3/CategorySystem>
5208
5209 =cut
5210
5211 sub _system() {
5212 state $done++ && return;
5213 #
5214 _error();
5215 _keyboard();
5216 _stdinc();
5217 _video();
5218
5219 # if defined(SDL_PLATFORM_WINDOWS)
5220 if ( $^O eq 'MSWin32' ) {
5221 _typedef_and_export MSG => Void;
5222 _typedef_and_export SDL_WindowsMessageHook => Callback [ [ Pointer [Void], Pointer [ MSG() ] ] => Bool ];
5223 _affix_and_export SDL_SetWindowsMessageHook => [ SDL_WindowsMessageHook(), Pointer [Void] ], Void;
5224 }
5225
5226 # if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
5227 if ( $^O eq 'MSWin32' ) {
5228 _affix_and_export SDL_GetDirect3D9AdapterIndex => [ SDL_DisplayID() ], Int;
5229 _affix_and_export SDL_GetDXGIOutputInfo => [ SDL_DisplayID(), Pointer [Int], Pointer [Int] ], Bool;
5230 }
5231
5232 # Unconditional in header, though usually implies X11 support
5233 _typedef_and_export XEvent => Void;
5234 _typedef_and_export SDL_X11EventHook => Callback [ [ Pointer [Void], Pointer [ XEvent() ] ] => Bool ];
5235 _affix_and_export SDL_SetX11EventHook => [ SDL_X11EventHook(), Pointer [Void] ], Void;
5236
5237 # ifdef SDL_PLATFORM_LINUX
5238 if ( $^O eq 'linux' ) {
5239 _affix_and_export SDL_SetLinuxThreadPriority => [ SInt64, Int ], Bool;
5240 _affix_and_export SDL_SetLinuxThreadPriorityAndPolicy => [ SInt64, Int, Int ], Bool;
5241 }
5242
5243 # ifdef SDL_PLATFORM_IOS
5244 if ( $^O eq 'darwin' && 0 ) { # Perl on iOS? Yeah, right...
5245 _typedef_and_export SDL_iOSAnimationCallback => Callback [ [ Pointer [Void] ] => Void ];
5246 _affix_and_export
5247 SDL_SetiOSAnimationCallback => [ Pointer [ SDL_Window() ], Int, SDL_iOSAnimationCallback(), Pointer [Void] ],
5248 Bool;
5249 _affix_and_export SDL_SetiOSEventPump => [Bool], Void;
5250 }
5251
5252 # ifdef SDL_PLATFORM_ANDROID
5253 if ( $^O eq 'android' ) {
5254 _affix_and_export SDL_GetAndroidJNIEnv => [], Pointer [Void];
5255 _affix_and_export SDL_GetAndroidActivity => [], Pointer [Void];
5256 _affix_and_export SDL_GetAndroidSDKVersion => [], Int;
5257 _affix_and_export SDL_IsChromebook => [], Bool;
5258 _affix_and_export SDL_IsDeXMode => [], Bool;
5259 _affix_and_export SDL_SendAndroidBackButton => [], Void;
5260 _const_and_export SDL_ANDROID_EXTERNAL_STORAGE_READ => 0x01;
5261 _const_and_export SDL_ANDROID_EXTERNAL_STORAGE_WRITE => 0x02;
5262 _affix_and_export SDL_GetAndroidInternalStoragePath => [], String;
5263 _affix_and_export SDL_GetAndroidExternalStorageState => [], UInt32;
5264 _affix_and_export SDL_GetAndroidExternalStoragePath => [], String;
5265 _affix_and_export SDL_GetAndroidCachePath => [], String;
5266 _typedef_and_export SDL_RequestAndroidPermissionCallback => Callback [ [ Pointer [Void], String, Bool ] => Void ];
5267 _affix_and_export
5268 SDL_RequestAndroidPermission => [ String, SDL_RequestAndroidPermissionCallback(), Pointer [Void] ],
5269 Bool;
5270 _affix_and_export SDL_ShowAndroidToast => [ String, Int, Int, Int, Int ], Bool;
5271 _affix_and_export SDL_SendAndroidMessage => [ UInt32, Int ], Bool;
5272 }
5273
5274 # General
5275 _affix_and_export SDL_IsTablet => [], Bool;
5276 _affix_and_export SDL_IsTV => [], Bool;
5277 _enum_and_export SDL_Sandbox =>
5278 [ 'SDL_SANDBOX_NONE', 'SDL_SANDBOX_UNKNOWN_CONTAINER', 'SDL_SANDBOX_FLATPAK', 'SDL_SANDBOX_SNAP', 'SDL_SANDBOX_MACOS' ];
5279 _affix_and_export SDL_GetSandbox => [], SDL_Sandbox();
5280 _affix_and_export SDL_OnApplicationWillTerminate => [], Void;
5281 _affix_and_export SDL_OnApplicationDidReceiveMemoryWarning => [], Void;
5282 _affix_and_export SDL_OnApplicationWillEnterBackground => [], Void;
5283 _affix_and_export SDL_OnApplicationDidEnterBackground => [], Void;
5284 _affix_and_export SDL_OnApplicationWillEnterForeground => [], Void;
5285 _affix_and_export SDL_OnApplicationDidEnterForeground => [], Void;
5286
5287 # ifdef SDL_PLATFORM_IOS
5288 if ( $^O eq 'darwin' && 0 ) {
5289 _affix_and_export SDL_OnApplicationDidChangeStatusBarOrientation => [], Void;
5290 }
5291
5292 # ifdef SDL_PLATFORM_GDK
5293 # Note: No standard Perl $^O for GDK, usually handled via custom build flags
5294 if (0) {
5295 _typedef_and_export XTaskQueueHandle => Pointer [Void];
5296 _typedef_and_export XUserHandle => Pointer [Void];
5297 _affix_and_export SDL_GetGDKTaskQueue => [ Pointer [ XTaskQueueHandle() ] ], Bool;
5298 _affix_and_export SDL_GetGDKDefaultUser => [ Pointer [ XUserHandle() ] ], Bool;
5299 }
5300 }
5301
5302 =head3 C<:thread> - Thread Management
5303
5304 SDL offers cross-platform thread management functions. These are mostly concerned with starting threads, setting their
5305 priority, and dealing with their termination.
5306
5307 See L<SDL3: CategoryThread|https://wiki.libsdl.org/SDL3/CategoryThread>
5308
5309 =cut
5310
5311 sub _thread () {
5312 state $done++ && return;
5313 #
5314 _error();
5315 _properties();
5316 _stdinc();
5317 _atomic();
5318 #
5319 _typedef_and_export SDL_TLSID => SDL_AtomicInt();
5320 _enum_and_export SDL_ThreadPriority =>
5321 [ 'SDL_THREAD_PRIORITY_LOW', 'SDL_THREAD_PRIORITY_NORMAL', 'SDL_THREAD_PRIORITY_HIGH', 'SDL_THREAD_PRIORITY_TIME_CRITICAL' ];
5322 _enum_and_export SDL_ThreadState => [ 'SDL_THREAD_UNKNOWN', 'SDL_THREAD_ALIVE', 'SDL_THREAD_DETACHED', 'SDL_THREAD_COMPLETE' ];
5323 _typedef_and_export SDL_ThreadFunction => Callback [ [ Pointer [Void] ] => Int ];
5324 _typedef_and_export SDL_Thread => Void;
5325 _typedef_and_export SDL_ThreadID => UInt64;
5326 _affix_and_export
5327 SDL_CreateThreadRuntime => [ SDL_ThreadFunction(), String, Pointer [Void], Pointer [Void], Pointer [Void] ],
5328 Pointer [ SDL_Thread() ];
5329 _func_and_export SDL_CreateThread => sub ( $fn, $name, $data ) {
5330 SDL_CreateThreadRuntime( $fn, $name, $data, undef, undef );
5331
5332 #~ SDL_CreateThreadRuntime( $fn, $name, $data, SDL_BeginThreadFunction(), SDL_EndThreadFunction() );
5333 # Since SDL_CreateThread is defined as a preprocessor macro wrapping
5334 # SDL_CreateThreadRuntime in the C header, I have bound
5335 # SDL_CreateThreadRuntime but aliased it to SDL_CreateThread. Callers will need
5336 # to pass undef (NULL) for the two function pointer arguments (pfnBeginThread,
5337 # pfnEndThread) which are used internally by the CRT.
5338 };
5339 _affix_and_export
5340 SDL_CreateThreadWithPropertiesRuntime => [ SDL_PropertiesID(), Pointer [Void], Pointer [Void] ],
5341 Pointer [ SDL_Thread() ];
5342 _func_and_export SDL_CreateThreadWithProperties => sub ($props) {
5343 SDL_CreateThreadWithPropertiesRuntime( $props, undef, undef );
5344
5345 #~ SDL_CreateThreadWithPropertiesRuntime( $props, SDL_BeginThreadFunction(), SDL_EndThreadFunction() );
5346 };
5347 _const_and_export SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER => 'SDL.thread.create.entry_function';
5348 _const_and_export SDL_PROP_THREAD_CREATE_NAME_STRING => 'SDL.thread.create.name';
5349 _const_and_export SDL_PROP_THREAD_CREATE_USERDATA_POINTER => 'SDL.thread.create.userdata';
5350 _const_and_export SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER => 'SDL.thread.create.stacksize';
5351 _affix_and_export SDL_GetThreadName => [ Pointer [ SDL_Thread() ] ], String;
5352 _affix_and_export SDL_GetCurrentThreadID => [], SDL_ThreadID();
5353 _affix_and_export SDL_GetThreadID => [ Pointer [ SDL_Thread() ] ], SDL_ThreadID();
5354 _affix_and_export SDL_SetCurrentThreadPriority => [ SDL_ThreadPriority() ], Bool;
5355 _affix_and_export SDL_WaitThread => [ Pointer [ SDL_Thread() ], Pointer [Int] ], Void;
5356 _affix_and_export SDL_GetThreadState => [ Pointer [ SDL_Thread() ] ], SDL_ThreadState();
5357 _affix_and_export SDL_DetachThread => [ Pointer [ SDL_Thread() ] ], Void;
5358 _affix_and_export SDL_GetTLS => [ Pointer [ SDL_TLSID() ] ], Pointer [Void];
5359 _typedef_and_export SDL_TLSDestructorCallback => Callback [ [ Pointer [Void] ] => Void ];
5360 _affix_and_export SDL_SetTLS => [ Pointer [ SDL_TLSID() ], Pointer [Void], SDL_TLSDestructorCallback() ], Bool;
5361 _affix_and_export SDL_CleanupTLS => [], Void;
5362 }
5363
5364 =head3 C<:time> - Date and Time
5365
5366 SDL realtime clock and date/time routines.
5367
5368 There are two data types that are used in this category: L<SDL_Time|https://wiki.libsdl.org/SDL3/SDL_Time>, which
5369 represents the nanoseconds since a specific moment (an "epoch"), and
5370 L<SDL_DateTime|https://wiki.libsdl.org/SDL3/SDL_DateTime>, which breaks time down into human-understandable components:
5371 years, months, days, hours, etc.
5372
5373 Much of the functionality is involved in converting those two types to other useful forms.
5374
5375 See L<SDL3: CategoryTime|https://wiki.libsdl.org/SDL3/CategoryTime>
5376
5377 =cut
5378
5379 sub _time () {
5380 state $done++ && return;
5381 #
5382 _error();
5383 _stdinc();
5384 #
5385 _typedef_and_export SDL_DateTime => Struct [
5386 year => Int,
5387 month => Int,
5388 day => Int,
5389 hour => Int,
5390 minute => Int,
5391 second => Int,
5392 nanosecond => Int,
5393 day_of_week => Int,
5394 utc_offset => Int
5395 ];
5396 _enum_and_export SDL_DateFormat => [ 'SDL_DATE_FORMAT_YYYYMMDD', 'SDL_DATE_FORMAT_DDMMYYYY', 'SDL_DATE_FORMAT_MMDDYYYY' ];
5397 _enum_and_export SDL_TimeFormat => [ 'SDL_TIME_FORMAT_24HR', 'SDL_TIME_FORMAT_12HR' ];
5398 _typedef_and_export SDL_Time => SInt64;
5399 _affix_and_export
5400 SDL_GetDateTimeLocalePreferences => [ Pointer [ SDL_DateFormat() ], Pointer [ SDL_TimeFormat() ] ],
5401 Bool;
5402 _affix_and_export SDL_GetCurrentTime => [ Pointer [ SDL_Time() ] ], Bool;
5403 _affix_and_export SDL_TimeToDateTime => [ SDL_Time(), Pointer [ SDL_DateTime() ], Bool ], Bool;
5404 _affix_and_export SDL_DateTimeToTime => [ Pointer [ SDL_DateTime() ], Pointer [ SDL_Time() ] ], Bool;
5405 _affix_and_export SDL_TimeToWindows => [ SDL_Time(), Pointer [UInt32], Pointer [UInt32] ], Void;
5406 _affix_and_export SDL_TimeFromWindows => [ UInt32, UInt32 ], SDL_Time();
5407 _affix_and_export SDL_GetDaysInMonth => [ Int, Int ], Int;
5408 _affix_and_export SDL_GetDayOfYear => [ Int, Int, Int ], Int;
5409 _affix_and_export SDL_GetDayOfWeek => [ Int, Int, Int ], Int;
5410 }
5411
5412 =head3 C<:timer> - Timer Support
5413
5414 SDL provides time management functionality. It is useful for dealing with (usually) small durations of time.
5415
5416 See L<SDL3: CategoryTimer|https://wiki.libsdl.org/SDL3/CategoryTimer>
5417
5418 =cut
5419
5420 sub _timer() {
5421 state $done++ && return;
5422 #
5423 _error();
5424 _stdinc();
5425 #
5426 _const_and_export SDL_MS_PER_SECOND => 1000;
5427 _const_and_export SDL_US_PER_SECOND => 1000000;
5428 _const_and_export SDL_NS_PER_SECOND => 1000000000;
5429 _const_and_export SDL_NS_PER_MS => 1000000;
5430 _const_and_export SDL_NS_PER_US => 1000;
5431 _func_and_export( SDL_SECONDS_TO_NS => sub ($S) { ( ( ($S) ) * SDL_NS_PER_SECOND() ) } );
5432 _func_and_export( SDL_NS_TO_SECONDS => sub ($NS) { ( ($NS) / SDL_NS_PER_SECOND() ) } );
5433 _func_and_export( SDL_MS_TO_NS => sub ($MS) { ( ( ($MS) ) * SDL_NS_PER_MS() ) } );
5434 _func_and_export( SDL_NS_TO_MS => sub ($NS) { ( ($NS) / SDL_NS_PER_MS() ) } );
5435 _func_and_export( SDL_US_TO_NS => sub ($US) { ( ( ($US) ) * SDL_NS_PER_US() ) } );
5436 _func_and_export( SDL_NS_TO_US => sub ($NS) { ( ($NS) / SDL_NS_PER_US() ) } );
5437 _affix_and_export 'SDL_GetTicks', [], UInt64;
5438 _affix_and_export 'SDL_GetTicksNS', [], UInt64;
5439 _affix_and_export 'SDL_GetPerformanceCounter', [], UInt64;
5440 _affix_and_export 'SDL_GetPerformanceFrequency', [], UInt64;
5441 _affix_and_export 'SDL_Delay', [UInt32], Void;
5442 _affix_and_export 'SDL_DelayNS', [UInt64], Void;
5443 _affix_and_export 'SDL_DelayPrecise', [UInt64], Void;
5444 _typedef_and_export SDL_TimerID => UInt32;
5445 _typedef_and_export SDL_TimerCallback => Callback [ [ Pointer [Void], SDL_TimerID(), UInt32 ] => UInt32 ];
5446 _affix_and_export SDL_AddTimer => [ UInt32, SDL_TimerCallback(), Pointer [Void] ], SDL_TimerID();
5447 _typedef_and_export SDL_NSTimerCallback => Callback [ [ Pointer [Void], SDL_TimerID(), UInt64 ] => UInt64 ];
5448 _affix_and_export SDL_AddTimerNS => [ UInt64, SDL_NSTimerCallback(), Pointer [Void] ], SDL_TimerID();
5449 _affix_and_export SDL_RemoveTimer => [ SDL_TimerID() ], Bool;
5450 }
5451
5452 =head3 C<:touch> - Touch Support
5453
5454 SDL offers touch input, on platforms that support it. It can manage multiple touch devices and track multiple fingers
5455 on those devices.
5456
5457 See L<SDL3: CategoryTouch|https://wiki.libsdl.org/SDL3/CategoryTouch>
5458
5459 =cut
5460
5461 sub _touch() {
5462 state $done++ && return;
5463 _error();
5464 _mouse();
5465 _stdinc();
5466 #
5467 _typedef_and_export SDL_TouchID => UInt64;
5468 _typedef_and_export SDL_FingerID => UInt64;
5469 _enum_and_export SDL_TouchDeviceType => [
5470 [ SDL_TOUCH_DEVICE_INVALID => -1 ], 'SDL_TOUCH_DEVICE_DIRECT',
5471 'SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE', 'SDL_TOUCH_DEVICE_INDIRECT_RELATIVE'
5472 ];
5473 _typedef_and_export SDL_Finger => Struct [ id => SDL_FingerID(), x => Float, y => Float, pressure => Float ];
5474 _const_and_export SDL_TOUCH_MOUSEID => -1;
5475 _const_and_export SDL_MOUSE_TOUCHID => -1;
5476 _affix_and_export SDL_GetTouchDevices => [ Pointer [ SDL_TouchID() ] ], Pointer [Int];
5477 _affix_and_export SDL_GetTouchDeviceName => [ SDL_TouchID() ], String;
5478 _affix_and_export SDL_GetTouchDeviceType => [ SDL_TouchID() ], SDL_TouchDeviceType();
5479 _affix_and_export SDL_GetTouchFingers => [ SDL_TouchID(), Pointer [Int] ], Pointer [ Pointer [ SDL_Finger() ] ];
5480 }
5481
5482 =head3 C<:tray> - System Tray
5483
5484 SDL offers a way to add items to the "system tray" (more correctly called the "notification area" on Windows). On
5485 platforms that offer this concept, an SDL app can add a tray icon, submenus, checkboxes, and clickable entries, and
5486 register a callback that is fired when the user clicks on these pieces.
5487
5488 See L<SDL3: CategoryTray|https://wiki.libsdl.org/SDL3/CategoryTray>
5489
5490 =cut
5491
5492 sub _tray () {
5493 state $done++ && return;
5494 #
5495 _error();
5496 _stdinc();
5497 _surface();
5498 _video();
5499 #
5500 _typedef_and_export SDL_Tray => Void;
5501 _typedef_and_export SDL_TrayMenu => Void;
5502 _typedef_and_export SDL_TrayEntry => Void;
5503 _typedef_and_export SDL_TrayEntryFlags => UInt32;
5504 _const_and_export SDL_TRAYENTRY_BUTTON => 0x00000001;
5505 _const_and_export SDL_TRAYENTRY_CHECKBOX => 0x00000002;
5506 _const_and_export SDL_TRAYENTRY_SUBMENU => 0x00000004;
5507 _const_and_export SDL_TRAYENTRY_DISABLED => 0x80000000;
5508 _const_and_export SDL_TRAYENTRY_CHECKED => 0x40000000;
5509 _typedef_and_export SDL_TrayCallback => Callback [ [ Pointer [Void], Pointer [ SDL_TrayEntry() ] ] => Void ];
5510 _affix_and_export SDL_CreateTray => [ Pointer [ SDL_Surface() ], String ], Pointer [ SDL_Tray() ];
5511 _affix_and_export SDL_SetTrayIcon => [ Pointer [ SDL_Tray() ], Pointer [ SDL_Surface() ] ], Void;
5512 _affix_and_export SDL_SetTrayTooltip => [ Pointer [ SDL_Tray() ], String ], Void;
5513 _affix_and_export SDL_CreateTrayMenu => [ Pointer [ SDL_Tray() ] ], Pointer [ SDL_TrayMenu() ];
5514 _affix_and_export SDL_CreateTraySubmenu => [ Pointer [ SDL_TrayEntry() ] ], Pointer [ SDL_TrayMenu() ];
5515 _affix_and_export SDL_GetTrayMenu => [ Pointer [ SDL_Tray() ] ], Pointer [ SDL_TrayMenu() ];
5516 _affix_and_export SDL_GetTraySubmenu => [ Pointer [ SDL_TrayEntry() ] ], Pointer [ SDL_TrayMenu() ];
5517 _affix_and_export
5518 SDL_GetTrayEntries => [ Pointer [ SDL_TrayMenu() ], Pointer [Int] ],
5519 Pointer [ Pointer [ SDL_TrayEntry() ] ];
5520 _affix_and_export SDL_RemoveTrayEntry => [ Pointer [ SDL_TrayEntry() ] ], Void;
5521 _affix_and_export
5522 SDL_InsertTrayEntryAt => [ Pointer [ SDL_TrayMenu() ], Int, String, SDL_TrayEntryFlags() ],
5523 Pointer [ SDL_TrayEntry() ];
5524 _affix_and_export SDL_SetTrayEntryLabel => [ Pointer [ SDL_TrayEntry() ], String ], Void;
5525 _affix_and_export SDL_GetTrayEntryLabel => [ Pointer [ SDL_TrayEntry() ] ], String;
5526 _affix_and_export SDL_SetTrayEntryChecked => [ Pointer [ SDL_TrayEntry() ], Bool ], Void;
5527 _affix_and_export SDL_GetTrayEntryChecked => [ Pointer [ SDL_TrayEntry() ] ], Bool;
5528 _affix_and_export SDL_SetTrayEntryEnabled => [ Pointer [ SDL_TrayEntry() ], Bool ], Void;
5529 _affix_and_export SDL_GetTrayEntryEnabled => [ Pointer [ SDL_TrayEntry() ] ], Bool;
5530 _affix_and_export
5531 SDL_SetTrayEntryCallback => [ Pointer [ SDL_TrayEntry() ], SDL_TrayCallback(), Pointer [Void] ],
5532 Void;
5533 _affix_and_export SDL_ClickTrayEntry => [ Pointer [ SDL_TrayEntry() ] ], Void;
5534 _affix_and_export SDL_DestroyTray => [ Pointer [ SDL_Tray() ] ], Void;
5535 _affix_and_export SDL_GetTrayEntryParent => [ Pointer [ SDL_TrayEntry() ] ], Pointer [ SDL_TrayMenu() ];
5536 _affix_and_export SDL_GetTrayMenuParentEntry => [ Pointer [ SDL_TrayMenu() ] ], Pointer [ SDL_TrayEntry() ];
5537 _affix_and_export SDL_GetTrayMenuParentTray => [ Pointer [ SDL_TrayMenu() ] ], Pointer [ SDL_Tray() ];
5538 _affix_and_export SDL_UpdateTrays => [], Void;
5539 }
5540
5541 =head3 C<:version> - Querying SDL Version
5542
5543 Functionality to query the current SDL version, both as headers the app was compiled against, and a library the app is
5544 linked to.
5545
5546 See L<SDL3: CategoryVersion|https://wiki.libsdl.org/SDL3/CategoryVersion>
5547
5548 =cut
5549
5550 sub _version() {
5551 state $done++ && return;
5552 #
5553 _stdinc();
5554 #
5555 _affix_and_export 'SDL_GetVersion', [], Int;
5556 _affix_and_export 'SDL_GetRevision', [], Int;
5557 _func_and_export SDL_MAJOR_VERSION => sub () { state $i //= SDL_VERSIONNUM_MAJOR( SDL_GetVersion() ); $i };
5558 _func_and_export SDL_MINOR_VERSION => sub () { state $i //= SDL_VERSIONNUM_MINOR( SDL_GetVersion() ); $i };
5559 _func_and_export SDL_MICRO_VERSION => sub () { state $i //= SDL_VERSIONNUM_MICRO( SDL_GetVersion() ); $i };
5560 _func_and_export SDL_VERSIONNUM => sub ( $major, $minor, $patch ) { ( ($major) * 1000000 + ($minor) * 1000 + ($patch) ) };
5561 _func_and_export SDL_VERSIONNUM_MAJOR => sub ($version) { int( ($version) / 1000000 ) };
5562 _func_and_export SDL_VERSIONNUM_MINOR => sub ($version) { int( ( ($version) / 1000 ) % 1000 ) };
5563 _func_and_export SDL_VERSIONNUM_MICRO => sub ($version) { int( ($version) % 1000 ) };
5564 _const_and_export SDL_VERSION => SDL_VERSIONNUM( SDL_MAJOR_VERSION(), SDL_MINOR_VERSION(), SDL_MICRO_VERSION() );
5565 _func_and_export SDL_VERSION_ATLEAST => sub ( $X, $Y, $Z ) { ( SDL_VERSION() >= SDL_VERSIONNUM( $X, $Y, $Z ) ); };
5566 }
5567
5568 =head3 C<:video> - Display and Window Management
5569
5570 SDL's video subsystem is largely interested in abstracting window management from the underlying operating system. You
5571 can create windows, manage them in various ways, set them fullscreen, and get events when interesting things happen
5572 with them, such as the mouse or keyboard interacting with a window.
5573
5574 See L<SDL3: CategoryVideo|https://wiki.libsdl.org/SDL3/CategoryVideo>
5575
5576 =cut
5577
5578 sub _video() {
5579 state $done++ && return;
5580 _error();
5581 _pixels();
5582 _properties();
5583 _rect();
5584 _stdinc();
5585 _surface();
5586 #
5587 _typedef_and_export SDL_DisplayID => UInt32;
5588 _typedef_and_export SDL_WindowID => UInt32;
5589 _const_and_export SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER => 'SDL.video.wayland.wl_display';
5590 _enum_and_export SDL_SystemTheme => [qw[SDL_SYSTEM_THEME_UNKNOWN SDL_SYSTEM_THEME_LIGHT SDL_SYSTEM_THEME_DARK]];
5591 _typedef_and_export 'SDL_DisplayModeData' => Pointer [Void];
5592 _typedef_and_export SDL_DisplayMode => Struct [
5593 displayID => SDL_DisplayID(),
5594 format => SDL_PixelFormat(),
5595 w => Int,
5596 h => Int,
5597 pixel_density => Float,
5598 refresh_rate => Float,
5599 refresh_rate_numerator => Int,
5600 refresh_rate_denominator => Int,
5601 internal => Pointer [ SDL_DisplayModeData() ]
5602 ];
5603 _enum_and_export SDL_DisplayOrientation => [
5604 'SDL_ORIENTATION_UNKNOWN', 'SDL_ORIENTATION_LANDSCAPE', 'SDL_ORIENTATION_LANDSCAPE_FLIPPED', 'SDL_ORIENTATION_PORTRAIT',
5605 'SDL_ORIENTATION_PORTRAIT_FLIPPED'
5606 ];
5607 _typedef_and_export SDL_Window => Void; # opaque
5608
5609 #
5610 _typedef_and_export SDL_WindowFlags => UInt64;
5611 _const_and_export SDL_WINDOW_FULLSCREEN => 0x0000000000000001;
5612 _const_and_export SDL_WINDOW_OPENGL => 0x0000000000000002;
5613 _const_and_export SDL_WINDOW_OCCLUDED => 0x0000000000000004;
5614 _const_and_export SDL_WINDOW_HIDDEN => 0x0000000000000008;
5615 _const_and_export SDL_WINDOW_BORDERLESS => 0x0000000000000010;
5616 _const_and_export SDL_WINDOW_RESIZABLE => 0x0000000000000020;
5617 _const_and_export SDL_WINDOW_MINIMIZED => 0x0000000000000040;
5618 _const_and_export SDL_WINDOW_MAXIMIZED => 0x0000000000000080;
5619 _const_and_export SDL_WINDOW_MOUSE_GRABBED => 0x0000000000000100;
5620 _const_and_export SDL_WINDOW_INPUT_FOCUS => 0x0000000000000200;
5621 _const_and_export SDL_WINDOW_MOUSE_FOCUS => 0x0000000000000400;
5622 _const_and_export SDL_WINDOW_EXTERNAL => 0x0000000000000800;
5623 _const_and_export SDL_WINDOW_MODAL => 0x0000000000001000;
5624 _const_and_export SDL_WINDOW_HIGH_PIXEL_DENSITY => 0x0000000000002000;
5625 _const_and_export SDL_WINDOW_MOUSE_CAPTURE => 0x0000000000004000;
5626 _const_and_export SDL_WINDOW_MOUSE_RELATIVE_MODE => 0x0000000000008000;
5627 _const_and_export SDL_WINDOW_ALWAYS_ON_TOP => 0x0000000000010000;
5628 _const_and_export SDL_WINDOW_UTILITY => 0x0000000000020000;
5629 _const_and_export SDL_WINDOW_TOOLTIP => 0x0000000000040000;
5630 _const_and_export SDL_WINDOW_POPUP_MENU => 0x0000000000080000;
5631 _const_and_export SDL_WINDOW_KEYBOARD_GRABBED => 0x0000000000100000;
5632 _const_and_export SDL_WINDOW_VULKAN => 0x0000000010000000;
5633 _const_and_export SDL_WINDOW_METAL => 0x0000000020000000;
5634 _const_and_export SDL_WINDOW_TRANSPARENT => 0x0000000040000000;
5635 _const_and_export SDL_WINDOW_NOT_FOCUSABLE => 0x0000000080000000;
5636 #
5637 _const_and_export SDL_WINDOWPOS_UNDEFINED_MASK => 0x1FFF0000;
5638 _func_and_export( SDL_WINDOWPOS_UNDEFINED_DISPLAY => sub ($X) { ( SDL_WINDOWPOS_UNDEFINED_MASK() | ($X) ) } );
5639 _const_and_export SDL_WINDOWPOS_UNDEFINED => SDL_WINDOWPOS_UNDEFINED_DISPLAY(0);
5640 _func_and_export( SDL_WINDOWPOS_ISUNDEFINED => sub ($X) { ( ( ($X) & 0xFFFF0000 ) == SDL_WINDOWPOS_UNDEFINED_MASK() ) } );
5641 _const_and_export SDL_WINDOWPOS_CENTERED_MASK => 0x2FFF0000;
5642 _func_and_export( SDL_WINDOWPOS_CENTERED_DISPLAY => sub ($X) { ( SDL_WINDOWPOS_CENTERED_MASK() | ($X) ) } );
5643 _const_and_export SDL_WINDOWPOS_CENTERED => SDL_WINDOWPOS_CENTERED_DISPLAY(0);
5644 _func_and_export( SDL_WINDOWPOS_ISCENTERED => sub ($X) { ( ( ($X) & 0xFFFF0000 ) == SDL_WINDOWPOS_CENTERED_MASK() ) } );
5645 #
5646 _enum_and_export SDL_FlashOperation => [qw[SDL_FLASH_CANCEL SDL_FLASH_BRIEFLY SDL_FLASH_UNTIL_FOCUSED]];
5647 #
5648 _enum_and_export SDL_ProgressState => [
5649 [ SDL_PROGRESS_STATE_INVALID => -1 ], qw[SDL_PROGRESS_STATE_NONE SDL_PROGRESS_STATE_INDETERMINATE SDL_PROGRESS_STATE_NORMAL
5650 SDL_PROGRESS_STATE_PAUSED SDL_PROGRESS_STATE_ERROR]
5651 ];
5652
5653 # Defined in src\video\openvr\SDL_openvrvideo.c as
5654 # struct SDL_GLContextState {
5655 # HGLRC hglrc;
5656 # };
5657 _typedef_and_export SDL_GLContextState => Struct [ hglrc => Pointer [Void] ];
5658 _typedef_and_export SDL_GLContext => Pointer [ SDL_GLContextState() ];
5659 _typedef_and_export SDL_EGLDisplay => Pointer [Void];
5660 _typedef_and_export SDL_EGLConfig => Pointer [Void];
5661 _typedef_and_export SDL_EGLSurface => Pointer [Void];
5662 _typedef_and_export SDL_EGLAttrib => Pointer [Void];
5663 _typedef_and_export SDL_EGLint => Int;
5664 _typedef_and_export SDL_EGLAttribArrayCallback => Callback [ [ Pointer [Void] ] => SDL_EGLAttrib() ];
5665 _typedef_and_export SDL_EGLIntArrayCallback => Callback [ [ Pointer [Void], SDL_EGLDisplay(), SDL_EGLConfig() ] => SDL_EGLint() ];
5666 _enum_and_export SDL_GLAttr => [
5667 qw[
5668 SDL_GL_RED_SIZE
5669 SDL_GL_GREEN_SIZE
5670 SDL_GL_BLUE_SIZE
5671 SDL_GL_ALPHA_SIZE
5672 SDL_GL_BUFFER_SIZE
5673 SDL_GL_DOUBLEBUFFER
5674 SDL_GL_DEPTH_SIZE
5675 SDL_GL_STENCIL_SIZE
5676 SDL_GL_ACCUM_RED_SIZE
5677 SDL_GL_ACCUM_GREEN_SIZE
5678 SDL_GL_ACCUM_BLUE_SIZE
5679 SDL_GL_ACCUM_ALPHA_SIZE
5680 SDL_GL_STEREO
5681 SDL_GL_MULTISAMPLEBUFFERS
5682 SDL_GL_MULTISAMPLESAMPLES
5683 SDL_GL_ACCELERATED_VISUAL
5684 SDL_GL_RETAINED_BACKING
5685 SDL_GL_CONTEXT_MAJOR_VERSION
5686 SDL_GL_CONTEXT_MINOR_VERSION
5687 SDL_GL_CONTEXT_FLAGS
5688 SDL_GL_CONTEXT_PROFILE_MASK
5689 SDL_GL_SHARE_WITH_CURRENT_CONTEXT
5690 SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
5691 SDL_GL_CONTEXT_RELEASE_BEHAVIOR
5692 SDL_GL_CONTEXT_RESET_NOTIFICATION
5693 SDL_GL_CONTEXT_NO_ERROR
5694 SDL_GL_FLOATBUFFERS
5695 SDL_GL_EGL_PLATFORM
5696 ]
5697 ];
5698 #
5699 _typedef_and_export SDL_GLProfile => UInt32;
5700 _const_and_export SDL_GL_CONTEXT_PROFILE_CORE => 0x0001;
5701 _const_and_export SDL_GL_CONTEXT_PROFILE_COMPATIBILITY => 0x0002;
5702 _const_and_export SDL_GL_CONTEXT_PROFILE_ES => 0x0004;
5703 #
5704 _typedef_and_export SDL_GLContextFlag => UInt32;
5705 _const_and_export SDL_GL_CONTEXT_DEBUG_FLAG => 0x0001;
5706 _const_and_export SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG => 0x0002;
5707 _const_and_export SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG => 0x0004;
5708 _const_and_export SDL_GL_CONTEXT_RESET_ISOLATION_FLAG => 0x0008;
5709 #
5710 _typedef_and_export SDL_GLContextReleaseFlag => UInt32;
5711 _const_and_export SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE => 0x0000;
5712 _const_and_export SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH => 0x0001;
5713 #
5714 _typedef_and_export SDL_GLContextResetNotification => UInt32;
5715 _const_and_export SDL_GL_CONTEXT_RESET_NO_NOTIFICATION => 0x0000;
5716 _const_and_export SDL_GL_CONTEXT_RESET_LOSE_CONTEXT => 0x0001;
5717 #
5718 _affix_and_export SDL_GetNumVideoDrivers => [], Int;
5719 _affix_and_export SDL_GetVideoDriver => [Int], String;
5720 _affix_and_export SDL_GetCurrentVideoDriver => [], String;
5721 _affix_and_export SDL_GetSystemTheme => [], SDL_SystemTheme();
5722 _affix_and_export SDL_GetDisplays => [ Pointer [Int] ], Pointer [ SDL_DisplayID() ];
5723 _affix_and_export SDL_GetPrimaryDisplay => [], SDL_DisplayID();
5724 #
5725 _affix_and_export SDL_GetDisplayProperties => [ SDL_DisplayID() ], SDL_PropertiesID();
5726 _const_and_export SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN => 'SDL.display.HDR_enabled';
5727 _const_and_export SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER => 'SDL.display.KMSDRM.panel_orientation';
5728 _const_and_export SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER => 'SDL.display.wayland.wl_output';
5729 _const_and_export SDL_PROP_DISPLAY_WINDOWS_HMONITOR_POINTER => 'SDL.display.windows.hmonitor';
5730 #
5731 _affix_and_export SDL_GetDisplayName => [ SDL_DisplayID() ], String;
5732 _affix_and_export SDL_GetDisplayBounds => [ SDL_DisplayID(), Pointer [ SDL_Rect() ] ], Bool;
5733 _affix_and_export SDL_GetDisplayUsableBounds => [ SDL_DisplayID(), Pointer [ SDL_Rect() ] ], Bool;
5734 _affix_and_export SDL_GetNaturalDisplayOrientation => [ SDL_DisplayID() ], SDL_DisplayOrientation();
5735 _affix_and_export SDL_GetCurrentDisplayOrientation => [ SDL_DisplayID() ], SDL_DisplayOrientation();
5736 _affix_and_export SDL_GetDisplayContentScale => [ SDL_DisplayID() ], Float;
5737 _affix_and_export SDL_GetFullscreenDisplayModes => [ SDL_DisplayID(), Pointer [Int] ], Pointer [ Pointer [ SDL_DisplayMode() ] ];
5738 _affix_and_export SDL_GetClosestFullscreenDisplayMode => [ SDL_DisplayID(), Int, Int, Float, Bool, SDL_DisplayMode() ], Bool;
5739 _affix_and_export SDL_GetDesktopDisplayMode => [ SDL_DisplayID() ], Pointer [ SDL_DisplayMode() ];
5740 _affix_and_export SDL_GetCurrentDisplayMode => [ SDL_DisplayID() ], Pointer [ SDL_DisplayMode() ];
5741 _affix_and_export SDL_GetDisplayForPoint => [ Pointer [ SDL_Point() ] ], SDL_DisplayID();
5742 _affix_and_export SDL_GetDisplayForRect => [ Pointer [ SDL_Point() ] ], SDL_DisplayID();
5743 _affix_and_export SDL_GetDisplayForWindow => [ Pointer [ SDL_Window() ] ], SDL_DisplayID();
5744 _affix_and_export SDL_GetWindowPixelDensity => [ Pointer [ SDL_Window() ] ], Float;
5745 _affix_and_export SDL_GetWindowDisplayScale => [ Pointer [ SDL_Window() ] ], Float;
5746 _affix_and_export SDL_SetWindowFullscreenMode => [ Pointer [ SDL_Window() ], Pointer [ SDL_DisplayMode() ] ], Bool;
5747 _affix_and_export SDL_GetWindowFullscreenMode => [ Pointer [ SDL_Window() ] ], Pointer [ SDL_DisplayMode() ];
5748 _affix_and_export SDL_GetWindowICCProfile => [ Pointer [ SDL_Window() ], Pointer [Size_t] ], Pointer [Void];
5749 _affix_and_export SDL_GetWindowPixelFormat => [ Pointer [ SDL_Window() ] ], SDL_PixelFormat();
5750 _affix_and_export SDL_GetWindows => [ Pointer [Int] ], Pointer [ Pointer [ SDL_Window() ] ];
5751 _affix_and_export SDL_CreateWindow => [ String, Int, Int, SDL_WindowFlags() ], Pointer [ SDL_Window() ];
5752 _affix_and_export SDL_CreatePopupWindow => [ Pointer [ SDL_Window() ], Int, Int, Int, Int, SDL_WindowFlags() ], Pointer [ SDL_Window() ];
5753 _affix_and_export SDL_CreateWindowWithProperties => [ SDL_PropertiesID() ], Pointer [ SDL_Window() ];
5754 #
5755 _affix_and_export SDL_GetWindowID => [ Pointer [ SDL_Window() ] ], SDL_WindowID();
5756 _affix_and_export SDL_GetWindowFromID => [ SDL_WindowID() ], Pointer [ SDL_Window() ];
5757 _affix_and_export SDL_GetWindowParent => [ Pointer [ SDL_Window() ] ], Pointer [ SDL_Window() ];
5758 _affix_and_export SDL_GetWindowProperties => [ Pointer [ SDL_Window() ] ], SDL_PropertiesID();
5759 #
5760 _const_and_export SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN => 'SDL.window.create.always_on_top';
5761 _const_and_export SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN => 'SDL.window.create.borderless';
5762 _const_and_export SDL_PROP_WINDOW_CREATE_CONSTRAIN_POPUP_BOOLEAN => 'SDL.window.create.constrain_popup';
5763 _const_and_export SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN => 'SDL.window.create.focusable';
5764 _const_and_export SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN => 'SDL.window.create.external_graphics_context';
5765 _const_and_export SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER => 'SDL.window.create.flags';
5766 _const_and_export SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN => 'SDL.window.create.fullscreen';
5767 _const_and_export SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER => 'SDL.window.create.height';
5768 _const_and_export SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN => 'SDL.window.create.hidden';
5769 _const_and_export SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN => 'SDL.window.create.high_pixel_density';
5770 _const_and_export SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN => 'SDL.window.create.maximized';
5771 _const_and_export SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN => 'SDL.window.create.menu';
5772 _const_and_export SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN => 'SDL.window.create.metal';
5773 _const_and_export SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN => 'SDL.window.create.minimized';
5774 _const_and_export SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN => 'SDL.window.create.modal';
5775 _const_and_export SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN => 'SDL.window.create.mouse_grabbed';
5776 _const_and_export SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN => 'SDL.window.create.opengl';
5777 _const_and_export SDL_PROP_WINDOW_CREATE_PARENT_POINTER => 'SDL.window.create.parent';
5778 _const_and_export SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN => 'SDL.window.create.resizable';
5779 _const_and_export SDL_PROP_WINDOW_CREATE_TITLE_STRING => 'SDL.window.create.title';
5780 _const_and_export SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN => 'SDL.window.create.transparent';
5781 _const_and_export SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN => 'SDL.window.create.tooltip';
5782 _const_and_export SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN => 'SDL.window.create.utility';
5783 _const_and_export SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN => 'SDL.window.create.vulkan';
5784 _const_and_export SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER => 'SDL.window.create.width';
5785 _const_and_export SDL_PROP_WINDOW_CREATE_X_NUMBER => 'SDL.window.create.x';
5786 _const_and_export SDL_PROP_WINDOW_CREATE_Y_NUMBER => 'SDL.window.create.y';
5787 _const_and_export SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER => 'SDL.window.create.cocoa.window';
5788 _const_and_export SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER => 'SDL.window.create.cocoa.view';
5789 _const_and_export SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER => 'SDL.window.create.uikit.windowscene';
5790 _const_and_export SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN => 'SDL.window.create.wayland.surface_role_custom';
5791 _const_and_export SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN => 'SDL.window.create.wayland.create_egl_window';
5792 _const_and_export SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER => 'SDL.window.create.wayland.wl_surface';
5793 _const_and_export SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER => 'SDL.window.create.win32.hwnd';
5794 _const_and_export SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER => 'SDL.window.create.win32.pixel_format_hwnd';
5795 _const_and_export SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER => 'SDL.window.create.x11.window';
5796 _const_and_export SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING => 'SDL.window.create.emscripten.canvas_id';
5797 _const_and_export SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN => 'SDL.window.create.emscripten.fill_document';
5798 _const_and_export SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => 'SDL.window.create.emscripten.keyboard_element';
5799 #
5800 _const_and_export SDL_PROP_WINDOW_SHAPE_POINTER => 'SDL.window.shape';
5801 _const_and_export SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN => 'SDL.window.HDR_enabled';
5802 _const_and_export SDL_PROP_WINDOW_SDR_WHITE_LEVEL_FLOAT => 'SDL.window.SDR_white_level';
5803 _const_and_export SDL_PROP_WINDOW_HDR_HEADROOM_FLOAT => 'SDL.window.HDR_headroom';
5804 _const_and_export SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER => 'SDL.window.android.window';
5805 _const_and_export SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER => 'SDL.window.android.surface';
5806 _const_and_export SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER => 'SDL.window.uikit.window';
5807 _const_and_export SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER => 'SDL.window.uikit.metal_view_tag';
5808 _const_and_export SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER => 'SDL.window.uikit.opengl.framebuffer';
5809 _const_and_export SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER => 'SDL.window.uikit.opengl.renderbuffer';
5810 _const_and_export SDL_PROP_WINDOW_UIKIT_OPENGL_RESOLVE_FRAMEBUFFER_NUMBER => 'SDL.window.uikit.opengl.resolve_framebuffer';
5811 _const_and_export SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER => 'SDL.window.kmsdrm.dev_index';
5812 _const_and_export SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER => 'SDL.window.kmsdrm.drm_fd';
5813 _const_and_export SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER => 'SDL.window.kmsdrm.gbm_dev';
5814 _const_and_export SDL_PROP_WINDOW_COCOA_WINDOW_POINTER => 'SDL.window.cocoa.window';
5815 _const_and_export SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER => 'SDL.window.cocoa.metal_view_tag';
5816 _const_and_export SDL_PROP_WINDOW_OPENVR_OVERLAY_ID_NUMBER => 'SDL.window.openvr.overlay_id';
5817 _const_and_export SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER => 'SDL.window.vivante.display';
5818 _const_and_export SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER => 'SDL.window.vivante.window';
5819 _const_and_export SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER => 'SDL.window.vivante.surface';
5820 _const_and_export SDL_PROP_WINDOW_WIN32_HWND_POINTER => 'SDL.window.win32.hwnd';
5821 _const_and_export SDL_PROP_WINDOW_WIN32_HDC_POINTER => 'SDL.window.win32.hdc';
5822 _const_and_export SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER => 'SDL.window.win32.instance';
5823 _const_and_export SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER => 'SDL.window.wayland.display';
5824 _const_and_export SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER => 'SDL.window.wayland.surface';
5825 _const_and_export SDL_PROP_WINDOW_WAYLAND_VIEWPORT_POINTER => 'SDL.window.wayland.viewport';
5826 _const_and_export SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER => 'SDL.window.wayland.egl_window';
5827 _const_and_export SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER => 'SDL.window.wayland.xdg_surface';
5828 _const_and_export SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER => 'SDL.window.wayland.xdg_toplevel';
5829 _const_and_export SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_EXPORT_HANDLE_STRING => 'SDL.window.wayland.xdg_toplevel_export_handle';
5830 _const_and_export SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER => 'SDL.window.wayland.xdg_popup';
5831 _const_and_export SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER => 'SDL.window.wayland.xdg_positioner';
5832 _const_and_export SDL_PROP_WINDOW_X11_DISPLAY_POINTER => 'SDL.window.x11.display';
5833 _const_and_export SDL_PROP_WINDOW_X11_SCREEN_NUMBER => 'SDL.window.x11.screen';
5834 _const_and_export SDL_PROP_WINDOW_X11_WINDOW_NUMBER => 'SDL.window.x11.window';
5835 _const_and_export SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING => 'SDL.window.emscripten.canvas_id';
5836 _const_and_export SDL_PROP_WINDOW_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN => 'SDL.window.emscripten.fill_document';
5837 _const_and_export SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => 'SDL.window.emscripten.keyboard_element';
5838 #
5839 _affix_and_export SDL_GetWindowFlags => [ Pointer [ SDL_Window() ] ], SDL_WindowFlags();
5840 _affix_and_export SDL_SetWindowTitle => [ Pointer [ SDL_Window() ], String ], Bool;
5841 _affix_and_export SDL_GetWindowTitle => [ Pointer [ SDL_Window() ] ], String;
5842 _affix_and_export SDL_SetWindowIcon => [ Pointer [ SDL_Window() ], Pointer [ SDL_Surface() ] ], Bool;
5843 _affix_and_export SDL_SetWindowPosition => [ Pointer [ SDL_Window() ], Int, Int ], Bool;
5844 _affix_and_export SDL_GetWindowPosition => [ Pointer [ SDL_Window() ], Pointer [Int], Pointer [Int] ], Bool;
5845 _affix_and_export SDL_SetWindowSize => [ Pointer [ SDL_Window() ], Int, Int, ], Bool;
5846 _affix_and_export SDL_GetWindowSize => [ Pointer [ SDL_Window() ], Pointer [Int], Pointer [Int] ], Bool;
5847 _affix_and_export SDL_GetWindowSafeArea => [ Pointer [ SDL_Window() ], Pointer [ SDL_Rect() ] ], Bool;
5848 _affix_and_export SDL_SetWindowAspectRatio => [ Pointer [ SDL_Window() ], Float, Float ], Bool;
5849 _affix_and_export SDL_GetWindowAspectRatio => [ Pointer [ SDL_Window() ], Pointer [Float], Pointer [Float] ], Bool;
5850 _affix_and_export SDL_GetWindowBordersSize => [ Pointer [ SDL_Window() ], Pointer [Int], Pointer [Int], Pointer [Int], Pointer [Int] ], Bool;
5851 _affix_and_export SDL_GetWindowSizeInPixels => [ Pointer [ SDL_Window() ], Pointer [Int], Pointer [Int] ], Bool;
5852 _affix_and_export SDL_SetWindowMinimumSize => [ Pointer [ SDL_Window() ], Int, Int ], Bool;
5853 _affix_and_export SDL_GetWindowMinimumSize => [ Pointer [ SDL_Window() ], Pointer [Int], Pointer [Int] ], Bool;
5854 _affix_and_export SDL_SetWindowMaximumSize => [ Pointer [ SDL_Window() ], Int, Int ], Bool;
5855 _affix_and_export SDL_GetWindowMaximumSize => [ Pointer [ SDL_Window() ], Pointer [Int], Pointer [Int] ], Bool;
5856 _affix_and_export SDL_SetWindowBordered => [ Pointer [ SDL_Window() ], Bool ], Bool;
5857 _affix_and_export SDL_SetWindowResizable => [ Pointer [ SDL_Window() ], Bool ], Bool;
5858 _affix_and_export SDL_SetWindowAlwaysOnTop => [ Pointer [ SDL_Window() ], Bool ], Bool;
5859 _affix_and_export SDL_ShowWindow => [ Pointer [ SDL_Window() ] ], Bool;
5860 _affix_and_export SDL_HideWindow => [ Pointer [ SDL_Window() ] ], Bool;
5861 _affix_and_export SDL_RaiseWindow => [ Pointer [ SDL_Window() ] ], Bool;
5862 _affix_and_export SDL_MaximizeWindow => [ Pointer [ SDL_Window() ] ], Bool;
5863 _affix_and_export SDL_MinimizeWindow => [ Pointer [ SDL_Window() ] ], Bool;
5864 _affix_and_export SDL_RestoreWindow => [ Pointer [ SDL_Window() ] ], Bool;
5865 _affix_and_export SDL_SetWindowFullscreen => [ Pointer [ SDL_Window() ], Bool ], Bool;
5866 _affix_and_export SDL_SyncWindow => [ Pointer [ SDL_Window() ] ], Bool;
5867 _affix_and_export SDL_WindowHasSurface => [ Pointer [ SDL_Window() ] ], Bool;
5868 _affix_and_export SDL_GetWindowSurface => [ Pointer [ SDL_Window() ] ], Pointer [ SDL_Surface() ];
5869 _affix_and_export SDL_SetWindowSurfaceVSync => [ Pointer [ SDL_Window() ], Int ], Bool;
5870 #
5871 _const_and_export SDL_WINDOW_SURFACE_VSYNC_DISABLED => 0;
5872 _const_and_export SDL_WINDOW_SURFACE_VSYNC_ADAPTIVE => (-1);
5873 #
5874 _affix_and_export SDL_GetWindowSurfaceVSync => [ Pointer [ SDL_Window() ], Pointer [Int] ], Bool;
5875 _affix_and_export SDL_UpdateWindowSurface => [ Pointer [ SDL_Window() ] ], Bool;
5876 _affix_and_export SDL_UpdateWindowSurfaceRects => [ Pointer [ SDL_Window() ], Pointer [ SDL_Rect() ], Int ], Bool;
5877 _affix_and_export SDL_DestroyWindowSurface => [ Pointer [ SDL_Window() ] ], Bool;
5878 _affix_and_export SDL_SetWindowKeyboardGrab => [ Pointer [ SDL_Window() ], Bool ], Bool;
5879 _affix_and_export SDL_SetWindowMouseGrab => [ Pointer [ SDL_Window() ], Bool ], Bool;
5880 _affix_and_export SDL_GetWindowKeyboardGrab => [ Pointer [ SDL_Window() ] ], Bool;
5881 _affix_and_export SDL_GetWindowMouseGrab => [ Pointer [ SDL_Window() ] ], Bool;
5882 _affix_and_export SDL_GetGrabbedWindow => [], Pointer [ SDL_Window() ];
5883 _affix_and_export SDL_SetWindowMouseRect => [ Pointer [ SDL_Window() ], Pointer [ SDL_Rect() ] ], Bool;
5884 _affix_and_export SDL_GetWindowMouseRect => [ Pointer [ SDL_Window() ] ], Pointer [ SDL_Rect() ];
5885 _affix_and_export SDL_SetWindowOpacity => [ Pointer [ SDL_Window() ], Float ], Bool;
5886 _affix_and_export SDL_GetWindowOpacity => [ Pointer [ SDL_Window() ] ], Float;
5887 _affix_and_export SDL_SetWindowParent => [ Pointer [ SDL_Window() ], Pointer [ SDL_Window() ] ], Bool;
5888 _affix_and_export SDL_SetWindowModal => [ Pointer [ SDL_Window() ], Bool ], Bool;
5889 _affix_and_export SDL_SetWindowFocusable => [ Pointer [ SDL_Window() ], Bool ], Bool;
5890 _affix_and_export SDL_ShowWindowSystemMenu => [ Pointer [ SDL_Window() ], Int, Int ], Bool;
5891 #
5892 _enum_and_export SDL_HitTestResult => [
5893 qw[
5894 SDL_HITTEST_NORMAL SDL_HITTEST_DRAGGABLE
5895 SDL_HITTEST_RESIZE_TOPLEFT SDL_HITTEST_RESIZE_TOP SDL_HITTEST_RESIZE_TOPRIGHT SDL_HITTEST_RESIZE_RIGHT
5896 SDL_HITTEST_RESIZE_BOTTOMRIGHT SDL_HITTEST_RESIZE_BOTTOM SDL_HITTEST_RESIZE_BOTTOMLEFT SDL_HITTEST_RESIZE_LEFT
5897 ]
5898 ];
5899 #
5900 _typedef_and_export SDL_HitTest => Callback [ [ Pointer [ SDL_Window() ], Pointer [ SDL_Point() ], Pointer [Void] ] => SDL_HitTestResult() ];
5901 _affix_and_export SDL_SetWindowHitTest => [ Pointer [ SDL_Window() ], SDL_HitTest(), Pointer [Void] ], Bool;
5902 _affix_and_export SDL_SetWindowShape => [ Pointer [ SDL_Window() ], Pointer [ SDL_Surface() ] ], Bool;
5903 _affix_and_export SDL_FlashWindow => [ Pointer [ SDL_Window() ], SDL_FlashOperation() ], Bool;
5904
5905 #~ _affix_and_export SDL_SetWindowProgressState => [ Pointer [ SDL_Window() ], SDL_ProgressState() ], Bool;
5906 #~ _affix_and_export SDL_GetWindowProgressState => [ Pointer [ SDL_Window() ] ], SDL_ProgressState();
5907 #~ _affix_and_export SDL_SetWindowProgressValue => [ Pointer [ SDL_Window() ], Float ], Bool;
5908 #~ _affix_and_export SDL_GetWindowProgressValue => [ Pointer [ SDL_Window() ] ], Float;
5909 _affix_and_export SDL_DestroyWindow => [ Pointer [ SDL_Window() ] ], Void;
5910 _affix_and_export SDL_ScreenSaverEnabled => [], Bool;
5911 _affix_and_export SDL_EnableScreenSaver => [], Bool;
5912 _affix_and_export SDL_DisableScreenSaver => [], Bool;
5913 _affix_and_export SDL_GL_LoadLibrary => [String], Bool;
5914 _affix_and_export SDL_GL_GetProcAddress => [String], SDL_FunctionPointer();
5915 _affix_and_export SDL_EGL_GetProcAddress => [String], SDL_FunctionPointer();
5916 _affix_and_export SDL_GL_UnloadLibrary => [], Void;
5917 _affix_and_export SDL_GL_ExtensionSupported => [String], Bool;
5918 _affix_and_export SDL_GL_ResetAttributes => [], Void;
5919 _affix_and_export SDL_GL_SetAttribute => [ SDL_GLAttr() ], Bool;
5920 _affix_and_export SDL_GL_GetAttribute => [ SDL_GLAttr(), Pointer [Int] ], Bool;
5921 _affix_and_export SDL_GL_CreateContext => [ Pointer [ SDL_Window() ] ], SDL_GLContext();
5922 _affix_and_export SDL_GL_MakeCurrent => [ Pointer [ SDL_Window(), SDL_GLContext() ] ], Bool;
5923 _affix_and_export SDL_GL_GetCurrentWindow => [], Pointer [ SDL_Window() ];
5924 _affix_and_export SDL_GL_GetCurrentContext => [], SDL_GLContext();
5925 _affix_and_export SDL_EGL_GetCurrentDisplay => [], SDL_EGLDisplay();
5926 _affix_and_export SDL_EGL_GetCurrentConfig => [], SDL_EGLConfig();
5927 _affix_and_export SDL_EGL_GetWindowSurface => [ Pointer [ SDL_Window() ] ], SDL_EGLSurface();
5928 _affix_and_export
5929 SDL_EGL_SetAttributeCallbacks => [ SDL_EGLAttribArrayCallback(), SDL_EGLIntArrayCallback(), SDL_EGLIntArrayCallback(), Pointer [Void] ],
5930 Void;
5931 _affix_and_export SDL_GL_SetSwapInterval => [Int], Bool;
5932 _affix_and_export SDL_GL_GetSwapInterval => [ Pointer [Int] ], Bool;
5933 _affix_and_export SDL_GL_SwapWindow => [ Pointer [ SDL_Window() ] ], Bool;
5934 _affix_and_export SDL_GL_DestroyContext => [ SDL_GLContext() ], Bool;
5935 }
5936
5937 =head3 C<:vulkan> - Vulkan Support
5938
5939 Functions for creating Vulkan surfaces on SDL windows.
5940
5941 See L<SDL3: CategoryVulkan|https://wiki.libsdl.org/SDL3/CategoryVulkan>
5942
5943 =cut
5944
5945 sub _vulkan () {
5946 state $done++ && return;
5947 #
5948 _error();
5949 _stdinc();
5950 _video();
5951
5952 # opaque pointers
5953 typedef VkInstance => Pointer [Void];
5954 typedef VkAllocationCallbacks => Pointer [Void];
5955 typedef VkSurfaceKHR => Pointer [Void];
5956 typedef VkPhysicalDevice => Pointer [Void];
5957 #
5958 _affix_and_export 'SDL_Vulkan_LoadLibrary', [String] => Bool;
5959 _affix_and_export 'SDL_Vulkan_GetVkGetInstanceProcAddr', [] => SDL_FunctionPointer();
5960 _affix_and_export 'SDL_Vulkan_UnloadLibrary', [] => Void;
5961 _affix_and_export 'SDL_Vulkan_GetInstanceExtensions', [ Pointer [UInt32] ] => Pointer [String];
5962 _affix_and_export 'SDL_Vulkan_CreateSurface', [ SDL_Window(), VkInstance(), VkAllocationCallbacks(), VkSurfaceKHR() ] => Bool;
5963 _affix_and_export 'SDL_Vulkan_DestroySurface', [ VkInstance(), VkSurfaceKHR(), VkAllocationCallbacks() ] => Void;
5964 _affix_and_export 'SDL_Vulkan_GetPresentationSupport', [ VkInstance(), VkPhysicalDevice(), UInt32 ] => Bool;
5965 }
5966
5967 END { # For :main
5968 return if $? != 0; # Don't run hook, we're crashing or exiting with an error
5969 $main_hook // return;
5970 my $SDL_AppInit = $main_hook->can('SDL_AppInit') // sub { SDL_Log('Missing SDL_AppInit callback for :main'); SDL_APP_FAILURE() };
5971 my $SDL_AppEvent = $main_hook->can('SDL_AppEvent') // sub { SDL_Log('Missing SDL_AppEvent callback for :main'); SDL_APP_FAILURE() };
5972 my $SDL_AppIterate = $main_hook->can('SDL_AppIterate') // sub { SDL_Log('Missing SDL_AppIterate callback for :main'); SDL_APP_FAILURE() };
5973 my $SDL_AppQuit = $main_hook->can('SDL_AppQuit') // sub { SDL_Log('Missing SDL_AppQuit callback for :main'); SDL_APP_FAILURE() };
5974 my @args = ( $0, @ARGV ); # Inject script name as argv[0]
5975 SDL_EnterAppMainCallbacks( scalar(@args), \@args, $SDL_AppInit, $SDL_AppIterate, $SDL_AppEvent, $SDL_AppQuit );
5976 }
5977 }
5978 1;
5979
5980 =pod
5981
5982 =head1 Prerequisites
5983
5984 SDL3.pm requires Perl v5.40.0+ and will attempt to locate existing system libraries or download official release
5985 archives/build from source.
5986
5987 To avoid compiling entire windowing and dependency stacks from scratch, ensure your system meets the following
5988 platform-specific prerequisites:
5989
5990 =head2 Linux (Ubuntu / Debian)
5991
5992 Install the core build tools and X11/Wayland development libraries:
5993
5994 sudo apt-get install -y --no-install-recommends \
5995 cmake ninja-build pkgconf curl \
5996 libx11-dev libxcb1-dev libxext-dev libxfixes-dev libxcursor-dev libxrandr-dev \
5997 libxi-dev libxrender-dev libxss-dev libxkbcommon-dev libwayland-dev
5998
5999 To compile satellite libraries (SDL3_image, SDL3_mixer, SDL3_ttf) against system codecs:
6000
6001 sudo apt-get install -y --no-install-recommends \
6002 libpng-dev libjpeg-dev libtiff-dev libwebp-dev libfreetype6-dev \
6003 libogg-dev libvorbis-dev libflac-dev libopus-dev libopusfile-dev \
6004 libsndfile1-dev libasound2-dev libpulse-dev libpipewire-0.3-dev \
6005 libudev-dev libdbus-1-dev libgl1-mesa-dev libegl1-mesa-dev \
6006 libibus-1.0-dev zlib1g-dev libbz2-dev
6007
6008 On Ubuntu 25.10+, system SDL3 packages can be installed directly:
6009
6010 sudo apt-get install -y libsdl3-dev libsdl3-image-dev libsdl3-ttf-dev libsdl3-mixer-dev
6011
6012 =head2 macOS
6013
6014 Install Homebrew packages to satisfy system checks and build dependencies:
6015
6016 brew install sdl3 sdl3_image sdl3_ttf sdl3_mixer cmake pkg-config
6017 brew install freetype libpng libtiff webp jpeg-turbo libogg libvorbis flac opus libsndfile
6018
6019 =head2 Windows
6020
6021 Strawberry Perl provides everything needed out-of-the-box. Alien::SDL3 will download official prebuilt SDL3 MinGW
6022 binaries matching your Perl architecture.
6023
6024 If using vcpkg instead:
6025
6026 vcpkg install sdl3 sdl3-image sdl3-ttf sdl3-mixer
6027 choco install make -y
6028
6029 =head2 FreeBSD
6030
6031 pkg install -y perl5 lang/gcc gmake git cmake ninja unzip pkgconf curl \
6032 libX11 libxcb libXext libXfixes libXcursor libXrandr libXi \
6033 libXrender libXScrnSaver libxkbcommon wayland xorgproto
6034
6035 B<Note:> C<gmake> is required by Alien::Xmake. Set C<export XMAKE_ROOT=y> if building as root.
6036
6037 =head2 OpenBSD
6038
6039 pkg_add git cmake ninja gmake curl unzip
6040
6041 Xenocara X11 and Clang ship with the base system. C<git> and C<gmake> are required.
6042
6043 =head2 NetBSD
6044
6045 export PKG_PATH="https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/$(uname -m)/10.0/All"
6046 pkg_add -U perl gmake git-base cmake ninja-build unzip pkgconf m4 curl
6047
6048 If base X11 is not installed, unpack the C<xbase.tar.xz> and C<xcomp.tar.xz> sets into C</usr/X11R7>, alias
6049 C<xscrnsaver.pc> to C<xss.pc>, and export:
6050
6051 export PATH="/usr/pkg/bin:/usr/pkg/sbin:$PATH"
6052 export PKG_CONFIG_PATH="/usr/X11R7/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
6053 export CMAKE_PREFIX_PATH="/usr/X11R7${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}"
6054
6055 =head2 DragonFly BSD
6056
6057 pkg install -y perl5 gcc curl gmake libunistring git cmake ninja unzip pkgconf \
6058 libX11 libxcb libXext libXfixes libXcursor libXrandr libXi libXrender \
6059 libXScrnSaver libxkbcommon wayland xorgproto
6060
6061 Pre-installing X11 packages prevents source builds of libxcb that fail on DragonFly BSD.
6062
6063 =head2 Solaris / illumos
6064
6065 Install developer tools, CMake, GNU tar, and X11 packages via IPS:
6066
6067 pkg install -v --accept perl-538 gcc developer/build/make developer/build/cmake archiver/gnu-tar bash git
6068 pkg install -v --accept \
6069 x11/header/x11-protocols x11/library/libx11 x11/library/libxcb \
6070 x11/library/libxext x11/library/libxfixes x11/library/libxcursor \
6071 x11/library/libxrandr x11/library/libxi x11/library/libxrender \
6072 x11/library/libxscrnsaver x11/library/libxtst x11/library/libxkbcommon
6073
6074 B<Crucial:> Solaris C</usr/bin/tar> lacks GNU C<-C> extract support. Place GNU tar on PATH ahead of system tar:
6075
6076 mkdir -p /tmp/gnutar && ln -sf /usr/bin/gtar /tmp/gnutar/tar
6077 export PATH="/tmp/gnutar:$PATH"
6078
6079 =head1 See Also
6080
6081 The project's repo: L<https://github.com/Perl-SDL3/>
6082
6083 The SDL3 Wiki: L<https://wiki.libsdl.org/SDL3/FrontPage>
6084
6085 L<Affix>
6086
6087 =head1 LICENSE
6088
6089 This software is Copyright (c) 2025 by Sanko Robinson.
6090
6091 This is free software, licensed under:
6092
6093 The Artistic License 2.0 (GPL Compatible)
6094
6095 See the F<LICENSE> file for full text.
6096
6097 =head1 AUTHOR
6098
6099 Sanko Robinson L<https://github.com/sanko>
6100
6101 =begin stopwords
6102
6103
6104 =end stopwords
6105
6106 =cut
« blib/lib/SDL3/Mixer.pm ↑ Summary