egra: optimised SSE memfill and colorblend
[iv.d.git] / sdl2 / sdl.d
blob71ffa13ebc2458aee679fc6a6403c8816fde0a25
1 /*
3 Boost Software License - Version 1.0 - August 17th, 2003
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
28 module iv.sdl2.sdl /*is aliced*/;
29 pragma(lib, "SDL2");
31 import core.stdc.stdio; // FILE
32 import core.stdc.stdarg; // va_list
33 import std.traits;
34 import iv.alice;
36 // SDL_version.h
37 struct SDL_version {
38 ubyte major;
39 ubyte minor;
40 ubyte patch;
43 enum : ubyte {
44 SDL_MAJOR_VERSION = 2,
45 SDL_MINOR_VERSION = 0,
46 SDL_PATCHLEVEL = 2,
49 void SDL_VERSION (ref SDL_version x) @safe pure {
50 x.major = SDL_MAJOR_VERSION;
51 x.minor = SDL_MINOR_VERSION;
52 x.patch = SDL_PATCHLEVEL;
55 uint SDL_VERSIONNUM() (ubyte X, ubyte Y, ubyte Z) { return X*1000+Y*100+Z; }
57 uint SDL_COMPILEDVERSION() () { return SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); }
59 bool SDL_VERSION_ATLEAST() (ubyte X, ubyte Y, ubyte Z) { return (SDL_COMPILEDVERSION() >= SDL_VERSIONNUM(X, Y, Z)); }
62 // From SDL_stdinc.h
63 alias int SDL_bool;
64 enum {
65 SDL_FALSE = 0,
66 SDL_TRUE = 1
69 uint SDL_FOURCC() (char A, char B, char C, char D) { return (A|(B<<8)|(C<<16)|(D<<24)); }
71 // SDL.h
72 enum : uint {
73 SDL_INIT_TIMER = 0x00000001,
74 SDL_INIT_AUDIO = 0x00000010,
75 SDL_INIT_VIDEO = 0x00000020,
76 SDL_INIT_JOYSTICK = 0x00000200,
77 SDL_INIT_HAPTIC = 0x00001000,
78 SDL_INIT_GAMECONTROLLER = 0x00002000,
79 SDL_INIT_EVENTS = 0x00004000,
80 SDL_INIT_NOPARACHUTE = 0x00100000,
81 SDL_INIT_EVERYTHING =
82 SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO |
83 SDL_INIT_EVENTS | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC |
84 SDL_INIT_GAMECONTROLLER
87 // SDL_assert.h
88 alias SDL_assert_state = uint;
90 enum : SDL_assert_state {
91 SDL_ASSERTION_RETRY = 0,
92 SDL_ASSERTION_BREAK = 1,
93 SDL_ASSERTION_ABORT = 2,
94 SDL_ASSERTION_IGNORE = 3,
95 SDL_ASSERTION_ALWAYS_IGNORE = 4
98 struct SDL_assert_data {
99 int always_ignore;
100 uint trigger_count;
101 const(char)* condition;
102 const(char)* filename;
103 int linenum;
104 const(char)* function_;
105 const(SDL_assert_data)* next;
108 extern(C) nothrow alias SDL_AssertionHandler = SDL_assert_state function (const(SDL_assert_data)* data, void* userdata);
110 // SDL_audio.h
111 alias SDL_AudioFormat = ushort;
113 enum : SDL_AudioFormat {
114 SDL_AUDIO_MASK_BITSIZE = 0xFF,
115 SDL_AUDIO_MASK_DATATYPE = 1<<8,
116 SDL_AUDIO_MASK_ENDIAN = 1<<12,
117 SDL_AUDIO_MASK_SIGNED = 1<<15,
120 ubyte SDL_AUDIO_BITSIZE() (SDL_AudioFormat x) { return cast(ubyte)(x&SDL_AUDIO_MASK_BITSIZE); }
121 bool SDL_AUDIO_ISFLOAT() (SDL_AudioFormat x) { return !!(x&SDL_AUDIO_MASK_DATATYPE); }
122 bool SDL_AUDIO_ISBIGENDIAN() (SDL_AudioFormat x) { return !!(x&SDL_AUDIO_MASK_ENDIAN); }
123 bool SDL_AUDIO_ISSIGNED() (SDL_AudioFormat x) { return !!(x&SDL_AUDIO_MASK_SIGNED); }
124 bool SDL_AUDIO_ISINT() (SDL_AudioFormat x) { return !SDL_AUDIO_ISFLOAT!(x); }
125 bool SDL_AUDIO_ISLITTLEENDIAN() (SDL_AudioFormat x) { return !SDL_AUDIO_ISBIGENDIAN!(x); }
126 bool SDL_AUDIO_ISUNSIGNED() (SDL_AudioFormat x) { return !SDL_AUDIO_ISSIGNED!(x); }
128 enum : SDL_AudioFormat {
129 AUDIO_U8 = 0x0008,
130 AUDIO_S8 = 0x8008,
131 AUDIO_U16LSB = 0x0010,
132 AUDIO_S16LSB = 0x8010,
133 AUDIO_U16MSB = 0x1010,
134 AUDIO_S16MSB = 0x9010,
135 AUDIO_U16 = AUDIO_U16LSB,
136 AUDIO_S16 = AUDIO_S16LSB,
137 AUDIO_S32LSB = 0x8020,
138 AUDIO_S32MSB = 0x9020,
139 AUDIO_S32 = AUDIO_S32LSB,
140 AUDIO_F32LSB = 0x8120,
141 AUDIO_F32MSB = 0x9120,
142 AUDIO_F32 = AUDIO_F32LSB,
145 version (LittleEndian) {
146 alias AUDIO_U16LSB AUDIO_U16SYS;
147 alias AUDIO_S16LSB AUDIO_S16SYS;
148 alias AUDIO_S32LSB AUDIO_S32SYS;
149 alias AUDIO_F32LSB AUDIO_F32SYS;
150 } else {
151 alias AUDIO_U16MSB AUDIO_U16SYS;
152 alias AUDIO_S16MSB AUDIO_S16SYS;
153 alias AUDIO_S32MSB AUDIO_S32SYS;
154 alias AUDIO_F32MSB AUDIO_F32SYS;
157 enum {
158 SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001,
159 SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002,
160 SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004,
161 SDL_AUDIO_ALLOW_ANY_CHANGE =
162 SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|
163 SDL_AUDIO_ALLOW_FORMAT_CHANGE|
164 SDL_AUDIO_ALLOW_CHANNELS_CHANGE,
167 extern(C) nothrow @nogc alias SDL_AudioCallback = void function (void* userdata, ubyte* stream, int len);
169 struct SDL_AudioSpec {
170 int freq;
171 SDL_AudioFormat format;
172 ubyte channels;
173 ubyte silence;
174 ushort samples;
175 ushort padding;
176 uint size;
177 SDL_AudioCallback callback;
178 void* userdata;
181 extern(C) nothrow alias SDL_AudioFilter = void function (SDL_AudioCVT* cvt, SDL_AudioFormat format);
183 struct SDL_AudioCVT {
184 int needed;
185 SDL_AudioFormat src_format;
186 SDL_AudioFormat dst_format;
187 double rate_incr;
188 ubyte* buf;
189 int len;
190 int len_cvt;
191 int len_mult;
192 double len_ratio;
193 SDL_AudioFilter[10] filters;
194 int filter_index;
197 alias uint SDL_AudioDeviceID;
199 alias SDL_AudioStatus = int;
201 enum {
202 SDL_AUDIO_STOPPED = 0,
203 SDL_AUDIO_PLAYING,
204 SDL_AUDIO_PAUSED,
207 enum SDL_MIX_MAXVOLUME = 128;
209 // SDL_blendmode.h
210 alias SDL_BlendMode = int;
212 enum {
213 SDL_BLENDMODE_NONE = 0x00000000,
214 SDL_BLENDMODE_BLEND = 0x00000001,
215 SDL_BLENDMODE_ADD = 0x00000002,
216 SDL_BLENDMODE_MOD = 0x00000004
219 // SDL_cpuinfo.h
220 enum SDL_CACHELINE_SIZE = 128;
222 // SDL_events.h
223 enum {
224 SDL_RELEASED = 0,
225 SDL_PRESSED = 1,
228 alias SDL_EventType = int;
230 enum {
231 SDL_FIRSTEVENT = 0,
232 SDL_QUIT = 0x100,
233 SDL_APP_TERMINATING,
234 SDL_APP_LOWMEMORY,
235 SDL_APP_WILLENTERBACKGROUND,
236 SDL_APP_DIDENTERBACKGROUND,
237 SDL_APP_WILLENTERFOREGROUND,
238 SDL_APP_DIDENTERFOREGROUND,
239 SDL_WINDOWEVENT = 0x200,
240 SDL_SYSWMEVENT,
241 SDL_KEYDOWN = 0x300,
242 SDL_KEYUP,
243 SDL_TEXTEDITING,
244 SDL_TEXTINPUT,
245 SDL_MOUSEMOTION = 0x400,
246 SDL_MOUSEBUTTONDOWN,
247 SDL_MOUSEBUTTONUP,
248 SDL_MOUSEWHEEL,
249 SDL_JOYAXISMOTION = 0x600,
250 SDL_JOYBALLMOTION,
251 SDL_JOYHATMOTION,
252 SDL_JOYBUTTONDOWN,
253 SDL_JOYBUTTONUP,
254 SDL_JOYDEVICEADDED,
255 SDL_JOYDEVICEREMOVED,
256 SDL_CONTROLLERAXISMOTION = 0x650,
257 SDL_CONTROLLERBUTTONDOWN,
258 SDL_CONTROLLERBUTTONUP,
259 SDL_CONTROLLERDEVICEADDED,
260 SDL_CONTROLLERDEVICEREMOVED,
261 SDL_CONTROLLERDEVICEREMAPPED,
262 SDL_FINGERDOWN = 0x700,
263 SDL_FINGERUP,
264 SDL_FINGERMOTION,
265 SDL_DOLLARGESTURE = 0x800,
266 SDL_DOLLARRECORD,
267 SDL_MULTIGESTURE,
268 SDL_CLIPBOARDUPDATE = 0x900,
269 SDL_DROPFILE = 0x1000,
270 SDL_RENDER_TARGETS_RESET = 0x2000,
271 SDL_USEREVENT = 0x8000,
272 SDL_LASTEVENT = 0xFFFF
275 struct SDL_CommonEvent {
276 uint type;
277 uint timestamp;
280 struct SDL_WindowEvent {
281 uint type;
282 uint timestamp;
283 uint windowID;
284 ubyte event;
285 ubyte padding1;
286 ubyte padding2;
287 ubyte padding3;
288 int data1;
289 int data2;
292 struct SDL_KeyboardEvent {
293 uint type;
294 uint timestamp;
295 uint windowID;
296 ubyte state;
297 ubyte repeat;
298 ubyte padding2;
299 ubyte padding3;
300 SDL_Keysym keysym;
303 enum SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32;
305 struct SDL_TextEditingEvent {
306 uint type;
307 uint timestamp;
308 uint windowID;
309 char[SDL_TEXTEDITINGEVENT_TEXT_SIZE] text;
310 int start;
311 int length;
314 enum SDL_TEXTINPUTEVENT_TEXT_SIZE = 32;
316 struct SDL_TextInputEvent {
317 uint type;
318 uint timestamp;
319 uint windowID;
320 char[SDL_TEXTINPUTEVENT_TEXT_SIZE] text;
323 struct SDL_MouseMotionEvent {
324 uint type;
325 uint timestamp;
326 uint windowID;
327 uint which;
328 uint state;
329 int x;
330 int y;
331 int xrel;
332 int yrel;
335 struct SDL_MouseButtonEvent {
336 uint type;
337 uint timestamp;
338 uint windowID;
339 uint which;
340 ubyte button;
341 ubyte state;
342 ubyte clicks;
343 ubyte padding1;
344 int x;
345 int y;
348 struct SDL_MouseWheelEvent {
349 uint type;
350 uint timestamp;
351 uint windowID;
352 uint which;
353 int x;
354 int y;
357 struct SDL_JoyAxisEvent {
358 uint type;
359 uint timestamp;
360 SDL_JoystickID which;
361 ubyte axis;
362 ubyte padding1;
363 ubyte padding2;
364 ubyte padding3;
365 short value;
366 ushort padding4;
369 struct SDL_JoyBallEvent {
370 uint type;
371 uint timestamp;
372 SDL_JoystickID which;
373 ubyte ball;
374 ubyte padding1;
375 ubyte padding2;
376 ubyte padding3;
377 short xrel;
378 short yrel;
381 struct SDL_JoyHatEvent {
382 uint type;
383 uint timestamp;
384 SDL_JoystickID which;
385 ubyte hat;
386 ubyte value;
387 ubyte padding1;
388 ubyte padding2;
391 struct SDL_JoyButtonEvent {
392 uint type;
393 uint timestamp;
394 SDL_JoystickID which;
395 ubyte button;
396 ubyte state;
397 ubyte padding1;
398 ubyte padding2;
401 struct SDL_JoyDeviceEvent {
402 uint type;
403 uint timestamp;
404 int which;
407 struct SDL_ControllerAxisEvent {
408 uint type;
409 uint timestamp;
410 SDL_JoystickID which;
411 ubyte axis;
412 ubyte padding1;
413 ubyte padding2;
414 ubyte padding3;
415 short value;
416 ushort padding4;
419 struct SDL_ControllerButtonEvent {
420 uint type;
421 uint timestamp;
422 SDL_JoystickID which;
423 ubyte button;
424 ubyte state;
425 ubyte padding1;
426 ubyte padding2;
429 struct SDL_ControllerDeviceEvent {
430 uint type;
431 uint timestamp;
432 int which;
435 struct SDL_TouchFingerEvent {
436 uint type;
437 uint timestamp;
438 SDL_TouchID touchId;
439 SDL_FingerID fingerId;
440 float x;
441 float y;
442 float dx;
443 float dy;
444 float pressure;
447 struct SDL_MultiGestureEvent {
448 uint type;
449 uint timestamp;
450 SDL_TouchID touchId;
451 float dTheta;
452 float dDist;
453 float x;
454 float y;
455 ushort numFingers;
456 ushort padding;
459 struct SDL_DollarGestureEvent {
460 uint type;
461 uint timestamp;
462 SDL_TouchID touchId;
463 SDL_GestureID gestureId;
464 uint numFingers;
465 float error;
466 float x;
467 float y;
470 struct SDL_DropEvent {
471 uint type;
472 uint timestamp;
473 char* file;
476 struct SDL_QuitEvent {
477 uint type;
478 uint timestamp;
481 struct SDL_OSEvent {
482 uint type;
483 uint timestamp;
486 struct SDL_UserEvent {
487 uint type;
488 uint timestamp;
489 uint windowID;
490 int code;
491 void* data1;
492 void* data2;
495 struct SDL_SysWMEvent {
496 uint type;
497 uint timestamp;
498 SDL_SysWMmsg* msg;
501 union SDL_Event {
502 uint type;
503 SDL_CommonEvent common;
504 SDL_WindowEvent window;
505 SDL_KeyboardEvent key;
506 SDL_TextEditingEvent edit;
507 SDL_TextInputEvent text;
508 SDL_MouseMotionEvent motion;
509 SDL_MouseButtonEvent button;
510 SDL_MouseWheelEvent wheel;
511 SDL_JoyAxisEvent jaxis;
512 SDL_JoyBallEvent jball;
513 SDL_JoyHatEvent jhat;
514 SDL_JoyButtonEvent jbutton;
515 SDL_JoyDeviceEvent jdevice;
516 SDL_ControllerAxisEvent caxis;
517 SDL_ControllerButtonEvent cbutton;
518 SDL_ControllerDeviceEvent cdevice;
519 SDL_QuitEvent quit;
520 SDL_UserEvent user;
521 SDL_SysWMEvent syswm;
522 SDL_TouchFingerEvent tfinger;
523 SDL_MultiGestureEvent mgesture;
524 SDL_DollarGestureEvent dgesture;
525 SDL_DropEvent drop;
527 ubyte[56] padding;
530 alias SDL_eventaction = int;
531 enum {
532 SDL_ADDEVENT,
533 SDL_PEEKEVENT,
534 SDL_GETEVENT
537 extern(C) nothrow alias SDL_EventFilter = int function (void* userdata, SDL_Event* event);
539 enum {
540 SDL_QUERY = -1,
541 SDL_IGNORE = 0,
542 SDL_DISABLE = 0,
543 SDL_ENABLE = 1,
546 // SDL_gamecontroller.h
547 struct SDL_GameController;
548 alias int SDL_GameControllerBindType;
550 enum {
551 SDL_CONTROLLER_BINDTYPE_NONE = 0,
552 SDL_CONTROLLER_BINDTYPE_BUTTON,
553 SDL_CONTROLLER_BINDTYPE_AXIS,
554 SDL_CONTROLLER_BINDTYPE_HAT,
557 struct SDL_GameControllerButtonBind {
558 SDL_GameControllerBindType bindType;
559 union value {
560 int button;
561 int axis;
562 struct hat {
563 int hat;
564 int hat_mask;
567 alias button = value.button;
568 alias axis = value.axis;
569 alias hat = value.hat;
572 alias SDL_GameControllerAxis = int;
574 enum {
575 SDL_CONTROLLER_AXIS_INVALID = -1,
576 SDL_CONTROLLER_AXIS_LEFTX,
577 SDL_CONTROLLER_AXIS_LEFTY,
578 SDL_CONTROLLER_AXIS_RIGHTX,
579 SDL_CONTROLLER_AXIS_RIGHTY,
580 SDL_CONTROLLER_AXIS_TRIGGERLEFT,
581 SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
582 SDL_CONTROLLER_AXIS_MAX
585 alias SDL_GameControllerButton = int;
587 enum {
588 SDL_CONTROLLER_BUTTON_INVALID = -1,
589 SDL_CONTROLLER_BUTTON_A,
590 SDL_CONTROLLER_BUTTON_B,
591 SDL_CONTROLLER_BUTTON_X,
592 SDL_CONTROLLER_BUTTON_Y,
593 SDL_CONTROLLER_BUTTON_BACK,
594 SDL_CONTROLLER_BUTTON_GUIDE,
595 SDL_CONTROLLER_BUTTON_START,
596 SDL_CONTROLLER_BUTTON_LEFTSTICK,
597 SDL_CONTROLLER_BUTTON_RIGHTSTICK,
598 SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
599 SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
600 SDL_CONTROLLER_BUTTON_DPAD_UP,
601 SDL_CONTROLLER_BUTTON_DPAD_DOWN,
602 SDL_CONTROLLER_BUTTON_DPAD_LEFT,
603 SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
604 SDL_CONTROLLER_BUTTON_MAX
607 // SDL_gesture.h
608 alias SDL_GestureID = long;
610 // SDL_haptic.h
611 struct SDL_Haptic;
613 enum : ushort {
614 SDL_HAPTIC_CONSTANT = 1<<0,
615 SDL_HAPTIC_SINE = 1<<1,
616 SDL_HAPTIC_LEFTRIGHT = 1<<2,
617 SDL_HAPTIC_TRIANGLE = 1<<3,
618 SDL_HAPTIC_SAWTOOTHUP = 1<<4,
619 SDL_HAPTIC_SAWTOOTHDOWN = 1<<5,
620 SDL_HAPTIC_RAMP = 1<<6,
621 SDL_HAPTIC_SPRING = 1<<7,
622 SDL_HAPTIC_DAMPER = 1<<8,
623 SDL_HAPTIC_INERTIA = 1<<9,
624 SDL_HAPTIC_FRICTION = 1<<10,
625 SDL_HAPTIC_CUSTOM = 1<<11,
626 SDL_HAPTIC_GAIN = 1<<12,
627 SDL_HAPTIC_AUTOCENTER = 1<<13,
628 SDL_HAPTIC_STATUS = 1<<14,
629 SDL_HAPTIC_PAUSE = 1<<15,
630 SDL_HAPTIC_POLAR = 0,
631 SDL_HAPTIC_CARTESIAN = 1,
632 SDL_HAPTIC_SPHERICAL = 2,
635 enum SDL_HAPTIC_INFINITY = 4294967295U;
637 struct SDL_HapticDirection {
638 ubyte type;
639 int[3] dir;
642 struct SDL_HapticConstant {
643 ushort type;
644 SDL_HapticDirection direction;
645 uint length;
646 ushort delay;
647 ushort button;
648 ushort interval;
649 short level;
650 ushort attack_length;
651 ushort attack_level;
652 ushort fade_length;
653 ushort fade_level;
656 struct SDL_HapticPeriodic {
657 ushort type;
658 SDL_HapticDirection direction;
659 uint length;
660 uint delay;
661 ushort button;
662 ushort interval;
663 ushort period;
664 short magnitude;
665 short offset;
666 ushort phase;
667 ushort attack_length;
668 ushort attack_level;
669 ushort fade_length;
670 ushort fade_level;
673 struct SDL_HapticCondition {
674 ushort type;
675 SDL_HapticDirection direciton;
676 uint length;
677 ushort delay;
678 ushort button;
679 ushort interval;
680 ushort[3] right_sat;
681 ushort[3] left_sat;
682 short[3] right_coeff;
683 short[3] left_coeff;
684 ushort[3] deadband;
685 ushort[3] center;
688 struct SDL_HapticRamp {
689 ushort type;
690 SDL_HapticDirection direction;
691 uint length;
692 ushort delay;
693 ushort button;
694 ushort interval;
695 short start;
696 short end;
697 ushort attack_length;
698 ushort attack_level;
699 ushort fade_length;
700 ushort fade_level;
703 struct SDL_HapticLeftRight {
704 ushort type;
705 uint length;
706 ushort large_magnitude;
707 ushort small_magnitude;
710 struct SDL_HapticCustom {
711 ushort type;
712 SDL_HapticDirection direction;
713 uint length;
714 ushort delay;
715 ushort button;
716 ushort interval;
717 ubyte channels;
718 ushort period;
719 ushort samples;
720 ushort* data;
721 ushort attack_length;
722 ushort attack_level;
723 ushort fade_length;
724 ushort fade_level;
727 union SDL_HapticEffect {
728 ushort type;
729 SDL_HapticConstant constant;
730 SDL_HapticPeriodic periodic;
731 SDL_HapticCondition condition;
732 SDL_HapticRamp ramp;
733 SDL_HapticLeftRight leftright;
734 SDL_HapticCustom custom;
737 // SDL_hints.h
738 enum : string {
739 SDL_HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION",
740 SDL_HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER",
741 SDL_HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS",
742 SDL_HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE",
743 SDL_HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY",
744 SDL_HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC",
745 SDL_HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER",
746 SDL_HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE",
747 SDL_HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA",
748 SDL_HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR",
749 SDL_HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD",
750 SDL_HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP",
751 SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS",
752 SDL_HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED",
753 SDL_HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS",
754 SDL_HINT_ACCELEROMETER_AS_JOYSTICK = "SDL_ACCELEROMETER_AS_JOYSTICK",
755 SDL_HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED",
756 SDL_HINT_GAMECONTROLLERCONFIG = "SDL_GAMECONTROLLERCONFIG",
757 SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS",
758 SDL_HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST",
759 SDL_HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION",
760 SDL_HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED",
761 SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK",
762 SDL_HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER",
763 SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT",
764 SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES",
767 alias SDL_HintPriority = int;
769 enum {
770 SDL_HINT_DEFAULT,
771 SDL_HINT_NORMAL,
772 SDL_HINT_OVERRIDE,
775 extern(C) nothrow alias SDL_HintCallback = void function (void*, const (char)*, const (char)*);
777 // SDL_joystick.h
778 struct SDL_Joystick;
780 struct JoystickGUID {
781 ubyte[16] data;
784 struct SDL_JoystickGUID {
785 ubyte[16] data;
788 alias SDL_JoystickID = int;
790 enum : ubyte {
791 SDL_HAT_CENTERED = 0x00,
792 SDL_HAT_UP = 0x01,
793 SDL_HAT_RIGHT = 0x02,
794 SDL_HAT_DOWN = 0x04,
795 SDL_HAT_LEFT = 0x08,
796 SDL_HAT_RIGHTUP = SDL_HAT_RIGHT|SDL_HAT_UP,
797 SDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT|SDL_HAT_DOWN,
798 SDL_HAT_LEFTUP = SDL_HAT_LEFT|SDL_HAT_UP,
799 SDL_HAT_LEFTDOWN = SDL_HAT_LEFT|SDL_HAT_DOWN,
802 // SDL_keyboard.h
803 struct SDL_Keysym {
804 SDL_Scancode scancode;
805 SDL_Keycode sym;
806 ushort mod;
807 uint unicode;
810 // SDL_messagebox.h
811 alias SDL_MessageBoxFlags = int;
813 enum {
814 SDL_MESSAGEBOX_ERROR = 0x00000010,
815 SDL_MESSAGEBOX_WARNING = 0x00000020,
816 SDL_MESSAGEBOX_INFORMATION = 0x00000040,
819 alias SDL_MessageBoxButtonFlags = int;
821 enum {
822 SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,
823 SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002,
826 struct SDL_MessageBoxButtonData {
827 uint flags;
828 int buttonid;
829 const (char)* text;
832 struct SDL_MessageBoxColor {
833 ubyte r, g, b;
836 alias SDL_MessageBoxColorType = int;
838 enum {
839 SDL_MESSAGEBOX_COLOR_BACKGROUND,
840 SDL_MESSAGEBOX_COLOR_TEXT,
841 SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
842 SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
843 SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
844 SDL_MESSAGEBOX_COLOR_MAX,
847 struct SDL_MessageBoxColorScheme {
848 SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_MAX] colors;
851 struct SDL_MessageBoxData {
852 uint flags;
853 SDL_Window* window;
854 const (char)* title;
855 const (char)* message;
856 int numbuttons;
857 const (SDL_MessageBoxButtonData)* buttons;
858 const (SDL_MessageBoxColorScheme)* colorScheme;
861 // SDL_scancode.h
862 alias SDL_Scancode = int;
864 enum {
865 SDL_SCANCODE_UNKNOWN = 0,
867 SDL_SCANCODE_A = 4,
868 SDL_SCANCODE_B = 5,
869 SDL_SCANCODE_C = 6,
870 SDL_SCANCODE_D = 7,
871 SDL_SCANCODE_E = 8,
872 SDL_SCANCODE_F = 9,
873 SDL_SCANCODE_G = 10,
874 SDL_SCANCODE_H = 11,
875 SDL_SCANCODE_I = 12,
876 SDL_SCANCODE_J = 13,
877 SDL_SCANCODE_K = 14,
878 SDL_SCANCODE_L = 15,
879 SDL_SCANCODE_M = 16,
880 SDL_SCANCODE_N = 17,
881 SDL_SCANCODE_O = 18,
882 SDL_SCANCODE_P = 19,
883 SDL_SCANCODE_Q = 20,
884 SDL_SCANCODE_R = 21,
885 SDL_SCANCODE_S = 22,
886 SDL_SCANCODE_T = 23,
887 SDL_SCANCODE_U = 24,
888 SDL_SCANCODE_V = 25,
889 SDL_SCANCODE_W = 26,
890 SDL_SCANCODE_X = 27,
891 SDL_SCANCODE_Y = 28,
892 SDL_SCANCODE_Z = 29,
894 SDL_SCANCODE_1 = 30,
895 SDL_SCANCODE_2 = 31,
896 SDL_SCANCODE_3 = 32,
897 SDL_SCANCODE_4 = 33,
898 SDL_SCANCODE_5 = 34,
899 SDL_SCANCODE_6 = 35,
900 SDL_SCANCODE_7 = 36,
901 SDL_SCANCODE_8 = 37,
902 SDL_SCANCODE_9 = 38,
903 SDL_SCANCODE_0 = 39,
905 SDL_SCANCODE_RETURN = 40,
906 SDL_SCANCODE_ESCAPE = 41,
907 SDL_SCANCODE_BACKSPACE = 42,
908 SDL_SCANCODE_TAB = 43,
909 SDL_SCANCODE_SPACE = 44,
911 SDL_SCANCODE_MINUS = 45,
912 SDL_SCANCODE_EQUALS = 46,
913 SDL_SCANCODE_LEFTBRACKET = 47,
914 SDL_SCANCODE_RIGHTBRACKET = 48,
915 SDL_SCANCODE_BACKSLASH = 49,
916 SDL_SCANCODE_NONUSHASH = 50,
917 SDL_SCANCODE_SEMICOLON = 51,
918 SDL_SCANCODE_APOSTROPHE = 52,
919 SDL_SCANCODE_GRAVE = 53,
920 SDL_SCANCODE_COMMA = 54,
921 SDL_SCANCODE_PERIOD = 55,
922 SDL_SCANCODE_SLASH = 56,
924 SDL_SCANCODE_CAPSLOCK = 57,
926 SDL_SCANCODE_F1 = 58,
927 SDL_SCANCODE_F2 = 59,
928 SDL_SCANCODE_F3 = 60,
929 SDL_SCANCODE_F4 = 61,
930 SDL_SCANCODE_F5 = 62,
931 SDL_SCANCODE_F6 = 63,
932 SDL_SCANCODE_F7 = 64,
933 SDL_SCANCODE_F8 = 65,
934 SDL_SCANCODE_F9 = 66,
935 SDL_SCANCODE_F10 = 67,
936 SDL_SCANCODE_F11 = 68,
937 SDL_SCANCODE_F12 = 69,
939 SDL_SCANCODE_PRINTSCREEN = 70,
940 SDL_SCANCODE_SCROLLLOCK = 71,
941 SDL_SCANCODE_PAUSE = 72,
942 SDL_SCANCODE_INSERT = 73,
943 SDL_SCANCODE_HOME = 74,
944 SDL_SCANCODE_PAGEUP = 75,
945 SDL_SCANCODE_DELETE = 76,
946 SDL_SCANCODE_END = 77,
947 SDL_SCANCODE_PAGEDOWN = 78,
948 SDL_SCANCODE_RIGHT = 79,
949 SDL_SCANCODE_LEFT = 80,
950 SDL_SCANCODE_DOWN = 81,
951 SDL_SCANCODE_UP = 82,
953 SDL_SCANCODE_NUMLOCKCLEAR = 83,
954 SDL_SCANCODE_KP_DIVIDE = 84,
955 SDL_SCANCODE_KP_MULTIPLY = 85,
956 SDL_SCANCODE_KP_MINUS = 86,
957 SDL_SCANCODE_KP_PLUS = 87,
958 SDL_SCANCODE_KP_ENTER = 88,
959 SDL_SCANCODE_KP_1 = 89,
960 SDL_SCANCODE_KP_2 = 90,
961 SDL_SCANCODE_KP_3 = 91,
962 SDL_SCANCODE_KP_4 = 92,
963 SDL_SCANCODE_KP_5 = 93,
964 SDL_SCANCODE_KP_6 = 94,
965 SDL_SCANCODE_KP_7 = 95,
966 SDL_SCANCODE_KP_8 = 96,
967 SDL_SCANCODE_KP_9 = 97,
968 SDL_SCANCODE_KP_0 = 98,
969 SDL_SCANCODE_KP_PERIOD = 99,
971 SDL_SCANCODE_NONUSBACKSLASH = 100,
972 SDL_SCANCODE_APPLICATION = 101,
973 SDL_SCANCODE_POWER = 102,
974 SDL_SCANCODE_KP_EQUALS = 103,
975 SDL_SCANCODE_F13 = 104,
976 SDL_SCANCODE_F14 = 105,
977 SDL_SCANCODE_F15 = 106,
978 SDL_SCANCODE_F16 = 107,
979 SDL_SCANCODE_F17 = 108,
980 SDL_SCANCODE_F18 = 109,
981 SDL_SCANCODE_F19 = 110,
982 SDL_SCANCODE_F20 = 111,
983 SDL_SCANCODE_F21 = 112,
984 SDL_SCANCODE_F22 = 113,
985 SDL_SCANCODE_F23 = 114,
986 SDL_SCANCODE_F24 = 115,
987 SDL_SCANCODE_EXECUTE = 116,
988 SDL_SCANCODE_HELP = 117,
989 SDL_SCANCODE_MENU = 118,
990 SDL_SCANCODE_SELECT = 119,
991 SDL_SCANCODE_STOP = 120,
992 SDL_SCANCODE_AGAIN = 121,
993 SDL_SCANCODE_UNDO = 122,
994 SDL_SCANCODE_CUT = 123,
995 SDL_SCANCODE_COPY = 124,
996 SDL_SCANCODE_PASTE = 125,
997 SDL_SCANCODE_FIND = 126,
998 SDL_SCANCODE_MUTE = 127,
999 SDL_SCANCODE_VOLUMEUP = 128,
1000 SDL_SCANCODE_VOLUMEDOWN = 129,
1001 SDL_SCANCODE_KP_COMMA = 133,
1002 SDL_SCANCODE_KP_EQUALSAS400 = 134,
1004 SDL_SCANCODE_INTERNATIONAL1 = 135,
1005 SDL_SCANCODE_INTERNATIONAL2 = 136,
1006 SDL_SCANCODE_INTERNATIONAL3 = 137,
1007 SDL_SCANCODE_INTERNATIONAL4 = 138,
1008 SDL_SCANCODE_INTERNATIONAL5 = 139,
1009 SDL_SCANCODE_INTERNATIONAL6 = 140,
1010 SDL_SCANCODE_INTERNATIONAL7 = 141,
1011 SDL_SCANCODE_INTERNATIONAL8 = 142,
1012 SDL_SCANCODE_INTERNATIONAL9 = 143,
1013 SDL_SCANCODE_LANG1 = 144,
1014 SDL_SCANCODE_LANG2 = 145,
1015 SDL_SCANCODE_LANG3 = 146,
1016 SDL_SCANCODE_LANG4 = 147,
1017 SDL_SCANCODE_LANG5 = 148,
1018 SDL_SCANCODE_LANG6 = 149,
1019 SDL_SCANCODE_LANG7 = 150,
1020 SDL_SCANCODE_LANG8 = 151,
1021 SDL_SCANCODE_LANG9 = 152,
1023 SDL_SCANCODE_ALTERASE = 153,
1024 SDL_SCANCODE_SYSREQ = 154,
1025 SDL_SCANCODE_CANCEL = 155,
1026 SDL_SCANCODE_CLEAR = 156,
1027 SDL_SCANCODE_PRIOR = 157,
1028 SDL_SCANCODE_RETURN2 = 158,
1029 SDL_SCANCODE_SEPARATOR = 159,
1030 SDL_SCANCODE_OUT = 160,
1031 SDL_SCANCODE_OPER = 161,
1032 SDL_SCANCODE_CLEARAGAIN = 162,
1033 SDL_SCANCODE_CRSEL = 163,
1034 SDL_SCANCODE_EXSEL = 164,
1036 SDL_SCANCODE_KP_00 = 176,
1037 SDL_SCANCODE_KP_000 = 177,
1038 SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
1039 SDL_SCANCODE_DECIMALSEPARATOR = 179,
1040 SDL_SCANCODE_CURRENCYUNIT = 180,
1041 SDL_SCANCODE_CURRENCYSUBUNIT = 181,
1042 SDL_SCANCODE_KP_LEFTPAREN = 182,
1043 SDL_SCANCODE_KP_RIGHTPAREN = 183,
1044 SDL_SCANCODE_KP_LEFTBRACE = 184,
1045 SDL_SCANCODE_KP_RIGHTBRACE = 185,
1046 SDL_SCANCODE_KP_TAB = 186,
1047 SDL_SCANCODE_KP_BACKSPACE = 187,
1048 SDL_SCANCODE_KP_A = 188,
1049 SDL_SCANCODE_KP_B = 189,
1050 SDL_SCANCODE_KP_C = 190,
1051 SDL_SCANCODE_KP_D = 191,
1052 SDL_SCANCODE_KP_E = 192,
1053 SDL_SCANCODE_KP_F = 193,
1054 SDL_SCANCODE_KP_XOR = 194,
1055 SDL_SCANCODE_KP_POWER = 195,
1056 SDL_SCANCODE_KP_PERCENT = 196,
1057 SDL_SCANCODE_KP_LESS = 197,
1058 SDL_SCANCODE_KP_GREATER = 198,
1059 SDL_SCANCODE_KP_AMPERSAND = 199,
1060 SDL_SCANCODE_KP_DBLAMPERSAND = 200,
1061 SDL_SCANCODE_KP_VERTICALBAR = 201,
1062 SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
1063 SDL_SCANCODE_KP_COLON = 203,
1064 SDL_SCANCODE_KP_HASH = 204,
1065 SDL_SCANCODE_KP_SPACE = 205,
1066 SDL_SCANCODE_KP_AT = 206,
1067 SDL_SCANCODE_KP_EXCLAM = 207,
1068 SDL_SCANCODE_KP_MEMSTORE = 208,
1069 SDL_SCANCODE_KP_MEMRECALL = 209,
1070 SDL_SCANCODE_KP_MEMCLEAR = 210,
1071 SDL_SCANCODE_KP_MEMADD = 211,
1072 SDL_SCANCODE_KP_MEMSUBTRACT = 212,
1073 SDL_SCANCODE_KP_MEMMULTIPLY = 213,
1074 SDL_SCANCODE_KP_MEMDIVIDE = 214,
1075 SDL_SCANCODE_KP_PLUSMINUS = 215,
1076 SDL_SCANCODE_KP_CLEAR = 216,
1077 SDL_SCANCODE_KP_CLEARENTRY = 217,
1078 SDL_SCANCODE_KP_BINARY = 218,
1079 SDL_SCANCODE_KP_OCTAL = 219,
1080 SDL_SCANCODE_KP_DECIMAL = 220,
1081 SDL_SCANCODE_KP_HEXADECIMAL = 221,
1083 SDL_SCANCODE_LCTRL = 224,
1084 SDL_SCANCODE_LSHIFT = 225,
1085 SDL_SCANCODE_LALT = 226,
1086 SDL_SCANCODE_LGUI = 227,
1087 SDL_SCANCODE_RCTRL = 228,
1088 SDL_SCANCODE_RSHIFT = 229,
1089 SDL_SCANCODE_RALT = 230,
1090 SDL_SCANCODE_RGUI = 231,
1092 SDL_SCANCODE_MODE = 257,
1094 SDL_SCANCODE_AUDIONEXT = 258,
1095 SDL_SCANCODE_AUDIOPREV = 259,
1096 SDL_SCANCODE_AUDIOSTOP = 260,
1097 SDL_SCANCODE_AUDIOPLAY = 261,
1098 SDL_SCANCODE_AUDIOMUTE = 262,
1099 SDL_SCANCODE_MEDIASELECT = 263,
1100 SDL_SCANCODE_WWW = 264,
1101 SDL_SCANCODE_MAIL = 265,
1102 SDL_SCANCODE_CALCULATOR = 266,
1103 SDL_SCANCODE_COMPUTER = 267,
1104 SDL_SCANCODE_AC_SEARCH = 268,
1105 SDL_SCANCODE_AC_HOME = 269,
1106 SDL_SCANCODE_AC_BACK = 270,
1107 SDL_SCANCODE_AC_FORWARD = 271,
1108 SDL_SCANCODE_AC_STOP = 272,
1109 SDL_SCANCODE_AC_REFRESH = 273,
1110 SDL_SCANCODE_AC_BOOKMARKS = 274,
1112 SDL_SCANCODE_BRIGHTNESSDOWN = 275,
1113 SDL_SCANCODE_BRIGHTNESSUP = 276,
1114 SDL_SCANCODE_DISPLAYSWITCH = 277,
1115 SDL_SCANCODE_KBDILLUMTOGGLE = 278,
1116 SDL_SCANCODE_KBDILLUMDOWN = 279,
1117 SDL_SCANCODE_KBDILLUMUP = 280,
1118 SDL_SCANCODE_EJECT = 281,
1119 SDL_SCANCODE_SLEEP = 282,
1121 SDL_SCANCODE_APP1 = 283,
1122 SDL_SCANCODE_APP2 = 284,
1124 SDL_NUM_SCANCODES = 512
1127 // SDL_keycode.h
1128 alias SDL_Keycode = int;
1130 enum SDLK_SCANCODE_MASK = 1<<30;
1132 T SDL_SCANCODE_TO_KEYCODE(T) (T x) if (isIntegral!T) { return (x|SDLK_SCANCODE_MASK); }
1134 enum {
1135 SDLK_UNKNOWN = 0,
1136 SDLK_RETURN = '\r',
1137 SDLK_ESCAPE = '\033',
1138 SDLK_BACKSPACE = '\b',
1139 SDLK_TAB = '\t',
1140 SDLK_SPACE = ' ',
1141 SDLK_EXCLAIM = '!',
1142 SDLK_QUOTEDBL = '"',
1143 SDLK_HASH = '#',
1144 SDLK_PERCENT = '%',
1145 SDLK_DOLLAR = '$',
1146 SDLK_AMPERSAND = '&',
1147 SDLK_QUOTE = '\'',
1148 SDLK_LEFTPAREN = '(',
1149 SDLK_RIGHTPAREN = ')',
1150 SDLK_ASTERISK = '*',
1151 SDLK_PLUS = '+',
1152 SDLK_COMMA = ',',
1153 SDLK_MINUS = '-',
1154 SDLK_PERIOD = '.',
1155 SDLK_SLASH = '/',
1156 SDLK_0 = '0',
1157 SDLK_1 = '1',
1158 SDLK_2 = '2',
1159 SDLK_3 = '3',
1160 SDLK_4 = '4',
1161 SDLK_5 = '5',
1162 SDLK_6 = '6',
1163 SDLK_7 = '7',
1164 SDLK_8 = '8',
1165 SDLK_9 = '9',
1166 SDLK_COLON = ':',
1167 SDLK_SEMICOLON = ';',
1168 SDLK_LESS = '<',
1169 SDLK_EQUALS = '=',
1170 SDLK_GREATER = '>',
1171 SDLK_QUESTION = '?',
1172 SDLK_AT = '@',
1174 SDLK_LEFTBRACKET = '[',
1175 SDLK_BACKSLASH = '\\',
1176 SDLK_RIGHTBRACKET = ']',
1177 SDLK_CARET = '^',
1178 SDLK_UNDERSCORE = '_',
1179 SDLK_BACKQUOTE = '`',
1180 SDLK_a = 'a',
1181 SDLK_b = 'b',
1182 SDLK_c = 'c',
1183 SDLK_d = 'd',
1184 SDLK_e = 'e',
1185 SDLK_f = 'f',
1186 SDLK_g = 'g',
1187 SDLK_h = 'h',
1188 SDLK_i = 'i',
1189 SDLK_j = 'j',
1190 SDLK_k = 'k',
1191 SDLK_l = 'l',
1192 SDLK_m = 'm',
1193 SDLK_n = 'n',
1194 SDLK_o = 'o',
1195 SDLK_p = 'p',
1196 SDLK_q = 'q',
1197 SDLK_r = 'r',
1198 SDLK_s = 's',
1199 SDLK_t = 't',
1200 SDLK_u = 'u',
1201 SDLK_v = 'v',
1202 SDLK_w = 'w',
1203 SDLK_x = 'x',
1204 SDLK_y = 'y',
1205 SDLK_z = 'z',
1207 SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CAPSLOCK),
1209 SDLK_F1 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F1),
1210 SDLK_F2 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F2),
1211 SDLK_F3 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F3),
1212 SDLK_F4 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F4),
1213 SDLK_F5 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F5),
1214 SDLK_F6 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F6),
1215 SDLK_F7 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F7),
1216 SDLK_F8 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F8),
1217 SDLK_F9 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F9),
1218 SDLK_F10 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F10),
1219 SDLK_F11 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F11),
1220 SDLK_F12 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F12),
1222 SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_PRINTSCREEN),
1223 SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_SCROLLLOCK),
1224 SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_PAUSE),
1225 SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_INSERT),
1226 SDLK_HOME = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_HOME),
1227 SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_PAGEUP),
1228 SDLK_DELETE = '\177',
1229 SDLK_END = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_END),
1230 SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_PAGEDOWN),
1231 SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_RIGHT),
1232 SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_LEFT),
1233 SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_DOWN),
1234 SDLK_UP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_UP),
1236 SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_NUMLOCKCLEAR),
1237 SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_DIVIDE),
1238 SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MULTIPLY),
1239 SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MINUS),
1240 SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_PLUS),
1241 SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_ENTER),
1242 SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_1),
1243 SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_2),
1244 SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_3),
1245 SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_4),
1246 SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_5),
1247 SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_6),
1248 SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_7),
1249 SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_8),
1250 SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_9),
1251 SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_0),
1252 SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_PERIOD),
1254 SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_APPLICATION),
1255 SDLK_POWER = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_POWER),
1256 SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_EQUALS),
1257 SDLK_F13 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F13),
1258 SDLK_F14 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F14),
1259 SDLK_F15 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F15),
1260 SDLK_F16 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F16),
1261 SDLK_F17 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F17),
1262 SDLK_F18 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F18),
1263 SDLK_F19 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F19),
1264 SDLK_F20 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F20),
1265 SDLK_F21 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F21),
1266 SDLK_F22 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F22),
1267 SDLK_F23 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F23),
1268 SDLK_F24 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_F24),
1269 SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_EXECUTE),
1270 SDLK_HELP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_HELP),
1271 SDLK_MENU = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_MENU),
1272 SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_SELECT),
1273 SDLK_STOP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_STOP),
1274 SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AGAIN),
1275 SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_UNDO),
1276 SDLK_CUT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CUT),
1277 SDLK_COPY = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_COPY),
1278 SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_PASTE),
1279 SDLK_FIND = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_FIND),
1280 SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_MUTE),
1281 SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_VOLUMEUP),
1282 SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_VOLUMEDOWN),
1283 SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_COMMA),
1284 SDLK_KP_EQUALSAS400 =
1285 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_EQUALSAS400),
1287 SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_ALTERASE),
1288 SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_SYSREQ),
1289 SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CANCEL),
1290 SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CLEAR),
1291 SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_PRIOR),
1292 SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_RETURN2),
1293 SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_SEPARATOR),
1294 SDLK_OUT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_OUT),
1295 SDLK_OPER = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_OPER),
1296 SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CLEARAGAIN),
1297 SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CRSEL),
1298 SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_EXSEL),
1300 SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_00),
1301 SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_000),
1302 SDLK_THOUSANDSSEPARATOR =
1303 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_THOUSANDSSEPARATOR),
1304 SDLK_DECIMALSEPARATOR =
1305 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_DECIMALSEPARATOR),
1306 SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CURRENCYUNIT),
1307 SDLK_CURRENCYSUBUNIT =
1308 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CURRENCYSUBUNIT),
1309 SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_LEFTPAREN),
1310 SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_RIGHTPAREN),
1311 SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_LEFTBRACE),
1312 SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_RIGHTBRACE),
1313 SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_TAB),
1314 SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_BACKSPACE),
1315 SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_A),
1316 SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_B),
1317 SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_C),
1318 SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_D),
1319 SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_E),
1320 SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_F),
1321 SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_XOR),
1322 SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_POWER),
1323 SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_PERCENT),
1324 SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_LESS),
1325 SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_GREATER),
1326 SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_AMPERSAND),
1327 SDLK_KP_DBLAMPERSAND =
1328 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_DBLAMPERSAND),
1329 SDLK_KP_VERTICALBAR =
1330 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_VERTICALBAR),
1331 SDLK_KP_DBLVERTICALBAR =
1332 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_DBLVERTICALBAR),
1333 SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_COLON),
1334 SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_HASH),
1335 SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_SPACE),
1336 SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_AT),
1337 SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_EXCLAM),
1338 SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MEMSTORE),
1339 SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MEMRECALL),
1340 SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MEMCLEAR),
1341 SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MEMADD),
1342 SDLK_KP_MEMSUBTRACT =
1343 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MEMSUBTRACT),
1344 SDLK_KP_MEMMULTIPLY =
1345 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MEMMULTIPLY),
1346 SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_MEMDIVIDE),
1347 SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_PLUSMINUS),
1348 SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_CLEAR),
1349 SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_CLEARENTRY),
1350 SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_BINARY),
1351 SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_OCTAL),
1352 SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_DECIMAL),
1353 SDLK_KP_HEXADECIMAL =
1354 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KP_HEXADECIMAL),
1356 SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_LCTRL),
1357 SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_LSHIFT),
1358 SDLK_LALT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_LALT),
1359 SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_LGUI),
1360 SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_RCTRL),
1361 SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_RSHIFT),
1362 SDLK_RALT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_RALT),
1363 SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_RGUI),
1365 SDLK_MODE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_MODE),
1367 SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AUDIONEXT),
1368 SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AUDIOPREV),
1369 SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AUDIOSTOP),
1370 SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AUDIOPLAY),
1371 SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AUDIOMUTE),
1372 SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_MEDIASELECT),
1373 SDLK_WWW = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_WWW),
1374 SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_MAIL),
1375 SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_CALCULATOR),
1376 SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_COMPUTER),
1377 SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AC_SEARCH),
1378 SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AC_HOME),
1379 SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AC_BACK),
1380 SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AC_FORWARD),
1381 SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AC_STOP),
1382 SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AC_REFRESH),
1383 SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_AC_BOOKMARKS),
1385 SDLK_BRIGHTNESSDOWN =
1386 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_BRIGHTNESSDOWN),
1387 SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_BRIGHTNESSUP),
1388 SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_DISPLAYSWITCH),
1389 SDLK_KBDILLUMTOGGLE =
1390 SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KBDILLUMTOGGLE),
1391 SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KBDILLUMDOWN),
1392 SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_KBDILLUMUP),
1393 SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_EJECT),
1394 SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE (SDL_SCANCODE_SLEEP)
1397 alias SDL_Keymod = int;
1399 enum {
1400 KMOD_NONE = 0x0000,
1401 KMOD_LSHIFT = 0x0001,
1402 KMOD_RSHIFT = 0x0002,
1403 KMOD_LCTRL = 0x0040,
1404 KMOD_RCTRL = 0x0080,
1405 KMOD_LALT = 0x0100,
1406 KMOD_RALT = 0x0200,
1407 KMOD_LGUI = 0x0400,
1408 KMOD_RGUI = 0x0800,
1409 KMOD_NUM = 0x1000,
1410 KMOD_CAPS = 0x2000,
1411 KMOD_MODE = 0x4000,
1412 KMOD_RESERVED = 0x8000,
1414 KMOD_CTRL = ( KMOD_LCTRL|KMOD_RCTRL),
1415 KMOD_SHIFT = ( KMOD_LSHIFT|KMOD_RSHIFT),
1416 KMOD_ALT = ( KMOD_LALT|KMOD_RALT),
1417 KMOD_GUI = ( KMOD_LGUI|KMOD_RGUI),
1420 // SDL_log.h
1421 enum SDL_MAX_LOG_MESSAGE = 4096;
1423 enum {
1424 SDL_LOG_CATEGORY_APPLICATION,
1425 SDL_LOG_CATEGORY_ERROR,
1426 SDL_LOG_CATEGORY_ASSERT,
1427 SDL_LOG_CATEGORY_SYSTEM,
1428 SDL_LOG_CATEGORY_AUDIO,
1429 SDL_LOG_CATEGORY_VIDEO,
1430 SDL_LOG_CATEGORY_RENDER,
1431 SDL_LOG_CATEGORY_INPUT,
1433 SDL_LOG_CATEGORY_RESERVED1,
1434 SDL_LOG_CATEGORY_RESERVED2,
1435 SDL_LOG_CATEGORY_RESERVED3,
1436 SDL_LOG_CATEGORY_RESERVED4,
1437 SDL_LOG_CATEGORY_RESERVED5,
1438 SDL_LOG_CATEGORY_RESERVED6,
1439 SDL_LOG_CATEGORY_RESERVED7,
1440 SDL_LOG_CATEGORY_RESERVED8,
1441 SDL_LOG_CATEGORY_RESERVED9,
1442 SDL_LOG_CATEGORY_RESERVED10,
1444 SDL_LOG_CATEGORY_CUSTOM
1447 alias SDL_LogPriority = int;
1449 enum {
1450 SDL_LOG_PRIORITY_VERBOSE = 1,
1451 SDL_LOG_PRIORITY_DEBUG,
1452 SDL_LOG_PRIORITY_INFO,
1453 SDL_LOG_PRIORITY_WARN,
1454 SDL_LOG_PRIORITY_ERROR,
1455 SDL_LOG_PRIORITY_CRITICAL,
1456 SDL_NUM_LOG_PRIORITIES
1459 extern(C) nothrow alias SDL_LogOutputFunction = void function (void*, int, SDL_LogPriority, const (char)*);
1461 // SDL_mouse.h
1462 struct SDL_Cursor;
1464 ubyte SDL_BUTTON(T) (T x) if (isIntegral!T) { return cast(ubyte)(1<<(x-1)); }
1466 alias SDL_SystemCursor = int;
1468 enum {
1469 SDL_SYSTEM_CURSOR_ARROW,
1470 SDL_SYSTEM_CURSOR_IBEAM,
1471 SDL_SYSTEM_CURSOR_WAIT,
1472 SDL_SYSTEM_CURSOR_CROSSHAIR,
1473 SDL_SYSTEM_CURSOR_WAITARROW,
1474 SDL_SYSTEM_CURSOR_SIZENWSE,
1475 SDL_SYSTEM_CURSOR_SIZENESW,
1476 SDL_SYSTEM_CURSOR_SIZEWE,
1477 SDL_SYSTEM_CURSOR_SIZENS,
1478 SDL_SYSTEM_CURSOR_SIZEALL,
1479 SDL_SYSTEM_CURSOR_NO,
1480 SDL_SYSTEM_CURSOR_HAND,
1481 SDL_NUM_SYSTEM_CURSORS
1484 enum : ubyte {
1485 SDL_BUTTON_LEFT = 1,
1486 SDL_BUTTON_MIDDLE = 2,
1487 SDL_BUTTON_RIGHT = 3,
1488 SDL_BUTTON_X1 = 4,
1489 SDL_BUTTON_X2 = 5,
1490 SDL_BUTTON_LMASK = SDL_BUTTON (SDL_BUTTON_LEFT),
1491 SDL_BUTTON_MMASK = SDL_BUTTON (SDL_BUTTON_MIDDLE),
1492 SDL_BUTTON_RMASK = SDL_BUTTON (SDL_BUTTON_RIGHT),
1493 SDL_BUTTON_X1MASK = SDL_BUTTON (SDL_BUTTON_X1),
1494 SDL_BUTTON_X2MASK = SDL_BUTTON (SDL_BUTTON_X2),
1497 // SDL_pixels.h
1498 enum SDL_ALPHA_OPAQUE = 255;
1499 enum SDL_ALPHA_TRANSPARENT = 0;
1501 enum {
1502 SDL_PIXELTYPE_UNKNOWN,
1503 SDL_PIXELTYPE_INDEX1,
1504 SDL_PIXELTYPE_INDEX4,
1505 SDL_PIXELTYPE_INDEX8,
1506 SDL_PIXELTYPE_PACKED8,
1507 SDL_PIXELTYPE_PACKED16,
1508 SDL_PIXELTYPE_PACKED32,
1509 SDL_PIXELTYPE_ARRAYU8,
1510 SDL_PIXELTYPE_ARRAYU16,
1511 SDL_PIXELTYPE_ARRAYU32,
1512 SDL_PIXELTYPE_ARRAYF16,
1513 SDL_PIXELTYPE_ARRAYF32
1516 enum {
1517 SDL_BITMAPORDER_NONE,
1518 SDL_BITMAPORDER_4321,
1519 SDL_BITMAPORDER_1234
1522 enum {
1523 SDL_PACKEDORDER_NONE,
1524 SDL_PACKEDORDER_XRGB,
1525 SDL_PACKEDORDER_RGBX,
1526 SDL_PACKEDORDER_ARGB,
1527 SDL_PACKEDORDER_RGBA,
1528 SDL_PACKEDORDER_XBGR,
1529 SDL_PACKEDORDER_BGRX,
1530 SDL_PACKEDORDER_ABGR,
1531 SDL_PACKEDORDER_BGRA
1534 enum {
1535 SDL_ARRAYORDER_NONE,
1536 SDL_ARRAYORDER_RGB,
1537 SDL_ARRAYORDER_RGBA,
1538 SDL_ARRAYORDER_ARGB,
1539 SDL_ARRAYORDER_BGR,
1540 SDL_ARRAYORDER_BGRA,
1541 SDL_ARRAYORDER_ABGR
1544 enum {
1545 SDL_PACKEDLAYOUT_NONE,
1546 SDL_PACKEDLAYOUT_332,
1547 SDL_PACKEDLAYOUT_4444,
1548 SDL_PACKEDLAYOUT_1555,
1549 SDL_PACKEDLAYOUT_5551,
1550 SDL_PACKEDLAYOUT_565,
1551 SDL_PACKEDLAYOUT_8888,
1552 SDL_PACKEDLAYOUT_2101010,
1553 SDL_PACKEDLAYOUT_1010102
1556 alias SDL_DEFINE_PIXELFOURCC = SDL_FOURCC;
1558 uint SDL_DEFINE_PIXELFORMAT(T0, T1, T2, T3, T4) (T0 type, T1 order, T2 layout, T3 bits, T4 bytes)
1559 if (isIntegral!T0 && isIntegral!T1 && isIntegral!T2 && isIntegral!T3 && isIntegral!T4)
1561 return cast(uint)((1<<28)|(type<<24)|(order<<20)|(layout<<16)|(bits<<8)|bytes);
1564 uint SDL_PIXELFLAG(T) (T X) if (isIntegral!T) { return (X>>28)&0x0F; }
1565 uint SDL_PIXELTYPE(T) (T X) if (isIntegral!T) { return (X>>24)&0x0F; }
1566 uint SDL_PIXELORDER(T) (T X) if (isIntegral!T) { return (X>>20)&0x0F; }
1567 uint SDL_PIXELLAYOUT(T) (T X) if (isIntegral!T) { return (X>>16)&0x0F; }
1568 uint SDL_BITSPERPIXEL(T) (T X) if (isIntegral!T) { return (X>>8)&0xFF; }
1569 uint SDL_BYTESPERPIXEL(T) (T X) if (isIntegral!T) {
1570 if (SDL_ISPIXELFORMAT_FOURCC(X)) {
1571 return (X == SDL_PIXELFORMAT_YUY2 || X == SDL_PIXELFORMAT_UYVY || X == SDL_PIXELFORMAT_YVYU ? 2 : 1);
1572 } else {
1573 return X&0xFF;
1577 bool SDL_ISPIXELFORMAT_INDEXED(T) (T format) if (isIntegral!T) {
1578 if (!SDL_ISPIXELFORMAT_FOURCC(format)) {
1579 immutable auto pixelType = SDL_PIXELTYPE(format);
1580 return (pixelType == SDL_PIXELTYPE_INDEX1 || pixelType == SDL_PIXELTYPE_INDEX4 || pixelType == SDL_PIXELTYPE_INDEX8);
1581 } else {
1582 return false;
1586 bool SDL_ISPIXELFORMAT_ALPHA(T) (T format) if (isIntegral!T) {
1587 if (!SDL_ISPIXELFORMAT_FOURCC(format)) {
1588 immutable auto pixelOrder = SDL_PIXELORDER (format);
1589 return (pixelOrder == SDL_PACKEDORDER_ARGB || pixelOrder == SDL_PACKEDORDER_RGBA || pixelOrder == SDL_PACKEDORDER_ABGR || pixelOrder == SDL_PACKEDORDER_BGRA);
1590 } else {
1591 return false;
1595 bool SDL_ISPIXELFORMAT_FOURCC(T) (T format) if (isIntegral!T) { return format && !(format&0x80000000); }
1597 enum {
1598 SDL_PIXELFORMAT_UNKNOWN,
1599 SDL_PIXELFORMAT_INDEX1LSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, 1, 0),
1600 SDL_PIXELFORMAT_INDEX1MSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0),
1601 SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0),
1602 SDL_PIXELFORMAT_INDEX4MSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, 4, 0),
1603 SDL_PIXELFORMAT_INDEX8 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
1604 SDL_PIXELFORMAT_RGB332 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_332, 8, 1),
1605 SDL_PIXELFORMAT_RGB444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2),
1606 SDL_PIXELFORMAT_RGB555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2),
1607 SDL_PIXELFORMAT_BGR555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_1555, 15, 2),
1608 SDL_PIXELFORMAT_ARGB4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2),
1609 SDL_PIXELFORMAT_RGBA4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_4444, 16, 2),
1610 SDL_PIXELFORMAT_ABGR4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_4444, 16, 2),
1611 SDL_PIXELFORMAT_BGRA4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_4444, 16, 2),
1612 SDL_PIXELFORMAT_ARGB1555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_1555, 16, 2),
1613 SDL_PIXELFORMAT_RGBA5551 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_5551, 16, 2),
1614 SDL_PIXELFORMAT_ABGR1555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1555, 16, 2),
1615 SDL_PIXELFORMAT_BGRA5551 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_5551, 16, 2),
1616 SDL_PIXELFORMAT_RGB565 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_565, 16, 2),
1617 SDL_PIXELFORMAT_BGR565 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_565, 16, 2),
1618 SDL_PIXELFORMAT_RGB24 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, 24, 3),
1619 SDL_PIXELFORMAT_BGR24 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, 24, 3),
1620 SDL_PIXELFORMAT_RGB888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_8888, 24, 4),
1621 SDL_PIXELFORMAT_RGBX8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, SDL_PACKEDLAYOUT_8888, 24, 4),
1622 SDL_PIXELFORMAT_BGR888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_8888, 24, 4),
1623 SDL_PIXELFORMAT_BGRX8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, SDL_PACKEDLAYOUT_8888, 24, 4),
1624 SDL_PIXELFORMAT_ARGB8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_8888, 32, 4),
1625 SDL_PIXELFORMAT_RGBA8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 32, 4),
1626 SDL_PIXELFORMAT_ABGR8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_8888, 32, 4),
1627 SDL_PIXELFORMAT_BGRA8888 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_8888, 32, 4),
1628 SDL_PIXELFORMAT_ARGB2101010 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_2101010, 32, 4),
1630 SDL_PIXELFORMAT_YV12 = SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
1631 SDL_PIXELFORMAT_IYUV = SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
1632 SDL_PIXELFORMAT_YUY2 = SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
1633 SDL_PIXELFORMAT_UYVY = SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
1634 SDL_PIXELFORMAT_YVYU = SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
1637 static assert (SDL_PIXELFORMAT_BGRX8888 == 0x16661804);
1639 struct SDL_Color {
1640 ubyte r;
1641 ubyte g;
1642 ubyte b;
1643 ubyte a;
1646 struct SDL_Palette {
1647 int ncolors;
1648 SDL_Color* colors;
1649 // NOTE: original was named 'version'
1650 uint version_;
1651 int refcount;
1654 struct SDL_PixelFormat {
1655 uint format;
1656 SDL_Palette *palette;
1657 ubyte BitsPerPixel;
1658 ubyte BytesPerPixel;
1659 ubyte[2] padding;
1660 uint Rmask;
1661 uint Gmask;
1662 uint Bmask;
1663 uint Amask;
1664 ubyte Rloss;
1665 ubyte Gloss;
1666 ubyte Bloss;
1667 ubyte Aloss;
1668 ubyte Rshift;
1669 ubyte Gshift;
1670 ubyte Bshift;
1671 ubyte Ashift;
1672 int refcount;
1673 SDL_PixelFormat* next;
1676 // SDL_power.h
1677 alias SDL_PowerState = int;
1678 enum {
1679 SDL_POWERSTATE_UNKNOWN,
1680 SDL_POWERSTATE_ON_BATTERY,
1681 SDL_POWERSTATE_NO_BATTERY,
1682 SDL_POWERSTATE_CHARGING,
1683 SDL_POWERSTATE_CHARGED
1686 // SDL_rect.h
1687 struct SDL_Point {
1688 int x;
1689 int y;
1692 struct SDL_Rect {
1693 int x, y;
1694 int w, h;
1697 bool SDL_RectEmpty() (const(SDL_Rect)* X) { return !X || ( X.w <= 0) || ( X.h <= 0); }
1698 bool SDL_RectEquals() (const(SDL_Rect)* A, const(SDL_Rect)* B) { return (A && B && A.x == B.x && A.y == B.y && A.w == B.w && A.h == B.h); }
1700 // SDL_render.h
1701 alias SDL_RendererFlags = uint;
1703 enum : uint {
1704 SDL_RENDERER_SOFTWARE = 0x00000001,
1705 SDL_RENDERER_ACCELERATED = 0x00000002,
1706 SDL_RENDERER_PRESENTVSYNC = 0x00000004,
1707 SDL_RENDERER_TARGETTEXTURE = 0x00000008,
1710 struct SDL_RendererInfo {
1711 const(char)* name;
1712 uint flags;
1713 uint num_texture_formats;
1714 uint[16] texture_formats;
1715 int max_texture_width;
1716 int max_texture_height;
1719 alias SDL_TextureAccess = int;
1721 enum {
1722 SDL_TEXTUREACCESS_STATIC,
1723 SDL_TEXTUREACCESS_STREAMING,
1724 SDL_TEXTUREACCESS_TARGET,
1727 alias SDL_TextureModulate = int;
1729 enum {
1730 SDL_TEXTUREMODULATE_NONE = 0x00000000,
1731 SDL_TEXTUREMODULATE_COLOR = 0x00000001,
1732 SDL_TEXTUREMODULATE_ALPHA = 0x00000002
1735 alias SDL_RendererFlip = int;
1737 enum {
1738 SDL_FLIP_NONE = 0x00000000,
1739 SDL_FLIP_HORIZONTAL = 0x00000001,
1740 SDL_FLIP_VERTICAL = 0x00000002,
1743 struct SDL_Renderer;
1744 struct SDL_Texture;
1746 // SDL_rwops.h
1747 enum {
1748 SDL_RWOPS_UNKNOWN = 0,
1749 SDL_RWOPS_WINFILE = 1,
1750 SDL_RWOPS_STDFILE = 2,
1751 SDL_RWOPS_JNIFILE = 3,
1752 SDL_RWOPS_MEMORY = 4,
1753 SDL_RWOPS_MEMORY_RO = 5,
1756 struct SDL_RWops {
1757 extern(C) nothrow {
1758 long function (SDL_RWops*) size;
1759 long function (SDL_RWops*, long, int) seek;
1760 usize function (SDL_RWops*, void*, usize, usize) read;
1761 usize function (SDL_RWops*, const (void)*, usize, usize) write;
1762 int function (SDL_RWops*) close;
1764 uint type;
1765 union Hidden {
1766 version (Windows) {
1767 struct Windowsio {
1768 SDL_bool append;
1769 void* h;
1770 struct Buffer {
1771 void* data;
1772 usize size;
1773 usize left;
1775 Buffer buffer;
1777 Windowsio windowsio;
1780 struct Stdio {
1781 SDL_bool autoclose;
1782 FILE* fp;
1784 Stdio stdio;
1786 struct Mem {
1787 void* base;
1788 void* here;
1789 void* stop;
1791 Mem mem;
1793 struct Unknown {
1794 void* data1;
1796 Unknown unknown;
1798 Hidden hidden;
1801 enum {
1802 RW_SEEK_SET = 0,
1803 RW_SEEK_CUR = 1,
1804 RW_SEEK_END = 2,
1807 nothrow {
1808 long SDL_RWsize (SDL_RWops* ctx) { return ctx.size (ctx); }
1809 long SDL_RWseek (SDL_RWops* ctx, long offset, int whence) { return ctx.seek (ctx, offset, whence); }
1810 long SDL_RWtell (SDL_RWops* ctx) { return ctx.seek (ctx, 0, RW_SEEK_CUR); }
1811 usize SDL_RWread (SDL_RWops* ctx, void* ptr, usize size, usize n) { return ctx.read (ctx, ptr, size, n); }
1812 usize SDL_RWwrite (SDL_RWops* ctx, const (void)* ptr, usize size, usize n) { return ctx.write (ctx, ptr, size, n); }
1813 int SDL_RWclose (SDL_RWops* ctx) { return ctx.close (ctx); }
1816 // SDL_shape.h
1817 enum {
1818 SDL_NONSHAPEABLE_WINDOW = -1,
1819 SDL_INVALID_SHAPE_ARGUMENT = -2,
1820 SDL_WINDOW_LACKS_SHAPE = -3,
1823 alias WindowShapeMode = int;
1825 enum {
1826 ShapeModeDefault,
1827 ShapeModeBinarizeAlpha,
1828 ShapeModeReverseBinarizeAlpha,
1829 ShapeModeColorKey
1832 bool SDL_SHAPEMODEALPHA() (WindowShapeMode mode) {
1833 return (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha);
1836 union SDL_WindowShapeParams {
1837 ubyte binarizationCutoff;
1838 SDL_Color colorKey;
1841 struct SDL_WindowShapeMode {
1842 WindowShapeMode mode;
1843 SDL_WindowShapeParams parameters;
1846 // SDL_surface.h
1847 enum {
1848 SDL_SWSURFACE = 0,
1849 SDL_PREALLOC = 0x00000001,
1850 SDL_RLEACCEL = 0x00000002,
1851 SDL_DONTFREE = 0x00000004,
1854 bool SDL_MUSTLOCK() (const SDL_Surface* S) { return ((S.flags&SDL_RLEACCEL) != 0); }
1856 struct SDL_BlitMap;
1858 struct SDL_Surface {
1859 uint flags;
1860 SDL_PixelFormat* format;
1861 int w, h;
1862 int pitch;
1863 void* pixels;
1864 void* userdata;
1865 int locked;
1866 void* lock_data;
1867 SDL_Rect clip_rect;
1868 SDL_BlitMap* map;
1869 int refcount;
1872 extern(C) nothrow alias SDL_blit = int function (SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect);
1874 // SDL_syswm.h
1875 alias SDL_SYSWM_TYPE = int;
1877 enum {
1878 SDL_SYSWM_UNKNOWN,
1879 SDL_SYSWM_WINDOWS,
1880 SDL_SYSWM_X11,
1881 SDL_SYSWM_DIRECTFB,
1882 SDL_SYSWM_COCOA,
1883 SDL_SYSWM_UIKIT,
1884 SDL_SYSWM_WAYLAND,
1885 SDL_SYSWM_MIR,
1886 SDL_SYSWM_WINRT,
1889 // SDL_SysWMmsg might have a different size that in SDL
1890 struct SDL_SysWMmsg {
1891 SDL_version version_;
1892 SDL_SYSWM_TYPE subsystem;
1893 // other data i don't care for now
1896 struct SDL_SysWMinfo {
1897 SDL_version version_; // version is reserved in D
1898 SDL_SYSWM_TYPE subsystem;
1900 static union info_ {
1901 version(Windows) {
1902 struct win_ {
1903 HWND window;
1905 win_ win;
1907 version(Posix) {
1908 struct x11_ {
1909 /*Display*/void* display;
1910 /*Window*/uint window;
1912 x11_ x11;
1915 info_ info;
1918 // SDL_timer.h
1919 extern(C) nothrow alias SDL_TimerCallback = uint function (uint interval, void* param);
1921 alias SDL_TimerID = int;
1923 bool SDL_TICKS_PASSED() (uint A, uint B) { return cast(int)(B-A) <= 0; }
1925 // SDL_touch.h
1926 alias SDL_TouchID = long;
1927 alias SDL_FingerID = long;
1929 struct SDL_Finger {
1930 SDL_FingerID id;
1931 float x;
1932 float y;
1933 float pressure;
1936 enum uint SDL_TOUCH_MOUSEID = cast(uint)-1;
1938 // SDL_video.h
1939 struct SDL_DisplayMode {
1940 uint format;
1941 int w;
1942 int h;
1943 int refresh_rate;
1944 void* driverdata;
1947 struct SDL_Window;
1949 alias SDL_WindowFlags = int;
1951 enum {
1952 SDL_WINDOW_FULLSCREEN = 0x00000001,
1953 SDL_WINDOW_OPENGL = 0x00000002,
1954 SDL_WINDOW_SHOWN = 0x00000004,
1955 SDL_WINDOW_HIDDEN = 0x00000008,
1956 SDL_WINDOW_BORDERLESS = 0x00000010,
1957 SDL_WINDOW_RESIZABLE = 0x00000020,
1958 SDL_WINDOW_MINIMIZED = 0x00000040,
1959 SDL_WINDOW_MAXIMIZED = 0x00000080,
1960 SDL_WINDOW_INPUT_GRABBED = 0x00000100,
1961 SDL_WINDOW_INPUT_FOCUS = 0x00000200,
1962 SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
1963 SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN|0x00001000,
1964 SDL_WINDOW_FOREIGN = 0x00000800,
1965 SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000,
1968 enum SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000;
1969 uint SDL_WINDOWPOS_UNDEFINED_DISPLAY(T) (T X) if (isIntegral!T) { return cast(uint)(SDL_WINDOWPOS_UNDEFINED_MASK|X); }
1970 enum SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_DISPLAY(0);
1971 bool SDL_WINDOWPOS_ISUNDEFINED(T) (T X) if (isIntegral!T) { return ((X&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK); }
1973 enum SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000;
1974 uint SDL_WINDOWPOS_CENTERED_DISPLAY(T) (T X) if (isIntegral!T) { return cast(uint)(SDL_WINDOWPOS_CENTERED_MASK|X); }
1975 enum SDL_WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED_DISPLAY (0);
1976 bool SDL_WINDOWPOS_ISCENTERED(T) (T X) if (isIntegral!T) { return ((X&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK); }
1978 alias SDL_WindowEventID = int;
1980 enum {
1981 SDL_WINDOWEVENT_NONE,
1982 SDL_WINDOWEVENT_SHOWN,
1983 SDL_WINDOWEVENT_HIDDEN,
1984 SDL_WINDOWEVENT_EXPOSED,
1985 SDL_WINDOWEVENT_MOVED,
1986 SDL_WINDOWEVENT_RESIZED,
1987 SDL_WINDOWEVENT_SIZE_CHANGED,
1988 SDL_WINDOWEVENT_MINIMIZED,
1989 SDL_WINDOWEVENT_MAXIMIZED,
1990 SDL_WINDOWEVENT_RESTORED,
1991 SDL_WINDOWEVENT_ENTER,
1992 SDL_WINDOWEVENT_LEAVE,
1993 SDL_WINDOWEVENT_FOCUS_GAINED,
1994 SDL_WINDOWEVENT_FOCUS_LOST,
1995 SDL_WINDOWEVENT_CLOSE
1998 alias SDL_GLContext = void*;
2000 alias SDL_GLattr = int;
2002 enum {
2003 SDL_GL_RED_SIZE,
2004 SDL_GL_GREEN_SIZE,
2005 SDL_GL_BLUE_SIZE,
2006 SDL_GL_ALPHA_SIZE,
2007 SDL_GL_BUFFER_SIZE,
2008 SDL_GL_DOUBLEBUFFER,
2009 SDL_GL_DEPTH_SIZE,
2010 SDL_GL_STENCIL_SIZE,
2011 SDL_GL_ACCUM_RED_SIZE,
2012 SDL_GL_ACCUM_GREEN_SIZE,
2013 SDL_GL_ACCUM_BLUE_SIZE,
2014 SDL_GL_ACCUM_ALPHA_SIZE,
2015 SDL_GL_STEREO,
2016 SDL_GL_MULTISAMPLEBUFFERS,
2017 SDL_GL_MULTISAMPLESAMPLES,
2018 SDL_GL_ACCELERATED_VISUAL,
2019 SDL_GL_RETAINED_BACKING,
2020 SDL_GL_CONTEXT_MAJOR_VERSION,
2021 SDL_GL_CONTEXT_MINOR_VERSION,
2022 SDL_GL_CONTEXT_EGL,
2023 SDL_GL_CONTEXT_FLAGS,
2024 SDL_GL_CONTEXT_PROFILE_MASK,
2025 SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
2026 SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
2029 alias SDL_GLprofile = int;
2031 enum {
2032 SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
2033 SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
2034 SDL_GL_CONTEXT_PROFILE_ES = 0x0004,
2037 alias SDL_GLcontextFlag = int;
2039 enum {
2040 SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
2041 SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
2042 SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004,
2043 SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008,
2047 extern(C) @nogc nothrow {
2048 // SDL.h
2049 int SDL_Init (uint);
2050 int SDL_InitSubSystem (uint);
2051 void SDL_QuitSubSystem (uint);
2052 uint SDL_WasInit (uint);
2053 void SDL_Quit ();
2054 void SDL_free (void* mem);
2056 // SDL_assert.h
2057 void SDL_SetAssertionHandler (SDL_AssertionHandler, void*);
2058 const(SDL_assert_data)* SDL_GetAssertionReport ();
2059 void SDL_ResetAssertionReport ();
2061 // SDL_audio.h
2062 int SDL_GetNumAudioDrivers ();
2063 const(char)* SDL_GetAudioDriver (int);
2064 int SDL_AudioInit (const(char)*);
2065 void SDL_AudioQuit ();
2066 const(char)* SDL_GetCurrentAudioDriver ();
2067 int SDL_OpenAudio (SDL_AudioSpec*, SDL_AudioSpec*);
2068 int SDL_GetNumAudioDevices (int);
2069 const(char)* SDL_GetAudioDeviceName (int, int);
2070 SDL_AudioDeviceID SDL_OpenAudioDevice (const(char)*, int, const(SDL_AudioSpec)*, SDL_AudioSpec*, int);
2071 SDL_AudioStatus SDL_GetAudioStatus ();
2072 SDL_AudioStatus SDL_GetAudioDeviceStatus (SDL_AudioDeviceID);
2073 void SDL_PauseAudio (int);
2074 void SDL_PauseAudioDevice (SDL_AudioDeviceID, int);
2075 SDL_AudioSpec* SDL_LoadWAV_RW (SDL_RWops*, int, SDL_AudioSpec*, ubyte**, uint*);
2076 void SDL_FreeWAV (ubyte*);
2077 int SDL_BuildAudioCVT (SDL_AudioCVT*, SDL_AudioFormat, ubyte, int, SDL_AudioFormat, ubyte, int);
2078 int SDL_ConvertAudio (SDL_AudioCVT*);
2079 void SDL_MixAudio (ubyte*, const(ubyte)*, uint, int);
2080 void SDL_MixAudioFormat (ubyte*, const(ubyte)*, SDL_AudioFormat, uint, int);
2081 void SDL_LockAudio ();
2082 void SDL_LockAudioDevice (SDL_AudioDeviceID);
2083 void SDL_UnlockAudio ();
2084 void SDL_UnlockAudioDevice (SDL_AudioDeviceID);
2085 void SDL_CloseAudio ();
2086 void SDL_CloseAudioDevice (SDL_AudioDeviceID);
2087 int SDL_AudioDeviceConnected (SDL_AudioDeviceID);
2089 // SDL_clipboard.h
2090 int SDL_SetClipboardText (const(char)*);
2091 char* SDL_GetClipboardText ();
2092 SDL_bool SDL_HasClipboardText ();
2094 // SDL_cpuinfo.h
2095 int SDL_GetCPUCount ();
2096 int SDL_GetCPUCacheLineSize ();
2097 SDL_bool SDL_HasRDTSC ();
2098 SDL_bool SDL_HasAltiVec ();
2099 SDL_bool SDL_HasMMX ();
2100 SDL_bool SDL_Has3DNow ();
2101 SDL_bool SDL_HasSSE ();
2102 SDL_bool SDL_HasSSE2 ();
2103 SDL_bool SDL_HasSSE3 ();
2104 SDL_bool SDL_HasSSE41 ();
2105 SDL_bool SDL_HasSSE42 ();
2106 SDL_bool SDL_HasAVX ();
2107 int SDL_GetSystemRAM ();
2109 // SDL_error.h
2110 void SDL_SetError (const(char)*, ...);
2111 const(char)* SDL_GetError ();
2112 void SDL_ClearError ();
2114 // SDL_events.h
2115 void SDL_PumpEvents ();
2116 int SDL_PeepEvents (SDL_Event*, int, SDL_eventaction, uint, uint);
2117 SDL_bool SDL_HasEvent (uint);
2118 SDL_bool SDL_HasEvents (uint, uint);
2119 void SDL_FlushEvent (uint);
2120 void SDL_FlushEvents (uint, uint);
2121 int SDL_PollEvent (SDL_Event*);
2122 int SDL_WaitEvent (SDL_Event*);
2123 int SDL_WaitEventTimeout (SDL_Event*, int);
2124 int SDL_PushEvent (SDL_Event*);
2125 void SDL_SetEventFilter (SDL_EventFilter, void*);
2126 void SDL_GetEventFilter (SDL_EventFilter*, void**);
2127 void SDL_AddEventWatch (SDL_EventFilter, void*);
2128 void SDL_DelEventWatch (SDL_EventFilter, void*);
2129 void SDL_FilterEvents (SDL_EventFilter, void*);
2130 ubyte SDL_EventState (uint, int);
2131 uint SDL_RegisterEvents (int);
2133 // SDL_gamecontroller.h
2134 int SDL_GameControllerAddMappingsFromRW (SDL_RWops*, int);
2135 int SDL_GameControllerAddMapping (const(char)*);
2136 char* SDL_GameControllerMappingForGUID (SDL_JoystickGUID);
2137 char* SDL_GameControllerMapping (SDL_GameController*);
2138 SDL_bool SDL_IsGameController (int);
2139 const(char)* SDL_GameControllerNameForIndex (int);
2140 SDL_GameController* SDL_GameControllerOpen (int);
2141 const(char)* SDL_GameControllerName (SDL_GameController*);
2142 SDL_bool SDL_GameControllerGetAttached (SDL_GameController*);
2143 SDL_Joystick* SDL_GameControllerGetJoystick (SDL_GameController*);
2144 int SDL_GameControllerEventState (int);
2145 void SDL_GameControllerUpdate ();
2146 SDL_GameControllerAxis SDL_GameControllerGetAxisFromString (const(char)*);
2147 const(char)* SDL_GameControllerGetStringForAxis (SDL_GameControllerAxis);
2148 SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis (SDL_GameController*, SDL_GameControllerAxis);
2149 short SDL_GameControllerGetAxis (SDL_GameController*, SDL_GameControllerAxis);
2150 SDL_GameControllerButton SDL_GameControllerGetButtonFromString (const(char*));
2151 const(char)* SDL_GameControllerGetStringForButton (SDL_GameControllerButton);
2152 SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton (SDL_GameController*, SDL_GameControllerButton);
2153 ubyte SDL_GameControllerGetButton (SDL_GameController*, SDL_GameControllerButton);
2154 void SDL_GameControllerClose (SDL_GameController*);
2156 // SDL_gesture.h
2157 int SDL_RecordGesture (SDL_TouchID);
2158 int SDL_SaveAllDollarTemplates (SDL_RWops*);
2159 int SDL_SaveDollarTemplate (SDL_GestureID, SDL_RWops*);
2160 int SDL_LoadDollarTemplates (SDL_TouchID, SDL_RWops*);
2162 // SDL_haptic.h
2163 int SDL_NumHaptics ();
2164 const(char)* SDL_HapticName (int);
2165 SDL_Haptic* SDL_HapticOpen (int);
2166 int SDL_HapticOpened (int);
2167 int SDL_HapticIndex (SDL_Haptic*);
2168 int SDL_MouseIsHaptic ();
2169 SDL_Haptic* SDL_HapticOpenFromMouse ();
2170 int SDL_JoystickIsHaptic (SDL_Joystick*);
2171 SDL_Haptic* SDL_HapticOpenFromJoystick (SDL_Joystick*);
2172 int SDL_HapticClose (SDL_Haptic*);
2173 int SDL_HapticNumEffects (SDL_Haptic*);
2174 int SDL_HapticNumEffectsPlaying (SDL_Haptic*);
2175 uint SDL_HapticQuery (SDL_Haptic*);
2176 int SDL_HapticNumAxes (SDL_Haptic*);
2177 int SDL_HapticEffectSupported (SDL_Haptic*, SDL_HapticEffect*);
2178 int SDL_HapticNewEffect (SDL_Haptic*, SDL_HapticEffect*);
2179 int SDL_HapticUpdateEffect (SDL_Haptic*, int, SDL_HapticEffect*);
2180 int SDL_HapticRunEffect (SDL_Haptic*, int, SDL_HapticEffect*);
2181 int SDL_HapticStopEffect (SDL_Haptic*, int);
2182 int SDL_HapticDestroyEffect (SDL_Haptic*, int);
2183 int SDL_HapticGetEffectStatus (SDL_Haptic*, int);
2184 int SDL_HapticSetGain (SDL_Haptic*, int);
2185 int SDL_HapticSetAutocenter (SDL_Haptic*, int);
2186 int SDL_HapticPause (SDL_Haptic*);
2187 int SDL_HapticUnpause (SDL_Haptic*);
2188 int SDL_HapticStopAll (SDL_Haptic*);
2189 int SDL_HapticRumbleSupported (SDL_Haptic*);
2190 int SDL_HapticRumbleInit (SDL_Haptic*);
2191 int SDL_HapticRumblePlay (SDL_Haptic*, float, uint);
2192 int SDL_HapticRumbleStop (SDL_Haptic*);
2194 // SDL_hints.h
2195 SDL_bool SDL_SetHintWithPriority (const(char)*, const(char)*, SDL_HintPriority);
2196 SDL_bool SDL_SetHint (const(char)*, const(char)*);
2197 const(char)* SDL_GetHint (const(char)*);
2198 void SDL_AddHintCallback (const(char)*, SDL_HintCallback, void*);
2199 void SDL_DelHintCallback (const(char)*, SDL_HintCallback, void*);
2200 void SDL_ClearHints ();
2202 // SDL_input.h
2203 int SDL_RedetectInputDevices ();
2204 int SDL_GetNumInputDevices ();
2205 const(char)* SDL_GetInputDeviceName (int);
2206 int SDL_IsDeviceDisconnected (int);
2208 // SDL_joystick.h
2209 int SDL_NumJoysticks ();
2210 const(char)* SDL_JoystickNameForIndex (int);
2211 SDL_Joystick* SDL_JoystickOpen (int);
2212 const(char)* SDL_JoystickName (SDL_Joystick*);
2213 JoystickGUID SDL_JoystickGetDeviceGUID (int);
2214 JoystickGUID SDL_JoystickGetGUID (SDL_Joystick*);
2215 char* SDL_JoystickGetGUIDString (JoystickGUID);
2216 JoystickGUID SDL_JoystickGetGUIDFromString (const(char)*);
2217 SDL_bool SDL_JoystickGetAttached (SDL_Joystick*);
2218 SDL_JoystickID SDL_JoystickInstanceID (SDL_Joystick*);
2219 int SDL_JoystickNumAxes (SDL_Joystick*);
2220 int SDL_JoystickNumBalls (SDL_Joystick*);
2221 int SDL_JoystickNumHats (SDL_Joystick*);
2222 int SDL_JoystickNumButtons (SDL_Joystick*);
2223 int SDL_JoystickUpdate (SDL_Joystick*);
2224 int SDL_JoystickEventState (int);
2225 short SDL_JoystickGetAxis (SDL_Joystick*, int);
2226 ubyte SDL_JoystickGetHat (SDL_Joystick*, int);
2227 int SDL_JoystickGetBall (SDL_Joystick*, int, int*, int*);
2228 ubyte SDL_JoystickGetButton (SDL_Joystick*, int);
2229 void SDL_JoystickClose (SDL_Joystick*);
2231 // SDL_keyboard.h
2232 SDL_Window* SDL_GetKeyboardFocus ();
2233 ubyte* SDL_GetKeyboardState (int*);
2234 SDL_Keymod SDL_GetModState ();
2235 void SDL_SetModState (SDL_Keymod);
2236 SDL_Keycode SDL_GetKeyFromScancode (SDL_Scancode);
2237 SDL_Scancode SDL_GetScancodeFromKey (SDL_Keycode);
2238 const(char)* SDL_GetScancodeName (SDL_Scancode);
2239 SDL_Scancode SDL_GetScancodeFromName (const(char)*);
2240 const(char)* SDL_GetKeyName (SDL_Keycode);
2241 SDL_Keycode SDL_GetKeyFromName (const(char)*);
2242 void SDL_StartTextInput ();
2243 SDL_bool SDL_IsTextInputActive ();
2244 void SDL_StopTextInput ();
2245 void SDL_SetTextInputRect (SDL_Rect*);
2246 SDL_bool SDL_HasScreenKeyboardSupport ();
2247 SDL_bool SDL_IsScreenKeyboardShown (SDL_Window*);
2249 // SDL_loadso.h
2250 void* SDL_LoadObject (const(char)*);
2251 void* SDL_LoadFunction (void*, const(char*));
2252 void SDL_UnloadObject (void*);
2254 // SDL_log.h
2255 void SDL_LogSetAllPriority (SDL_LogPriority);
2256 void SDL_LogSetPriority (int, SDL_LogPriority);
2257 SDL_LogPriority SDL_LogGetPriority (int);
2258 void SDL_LogResetPriorities ();
2259 void SDL_Log (const(char)*, ...);
2260 void SDL_LogVerbose (int, const(char)*, ...);
2261 void SDL_LogDebug (int, const(char)*, ...);
2262 void SDL_LogInfo (int, const(char)*, ...);
2263 void SDL_LogWarn (int, const(char)*, ...);
2264 void SDL_LogError (int, const(char)*, ...);
2265 void SDL_LogCritical (int, const(char)*, ...);
2266 void SDL_LogMessage (int, SDL_LogPriority, const(char)*, ...);
2267 void SDL_LogMessageV (int, SDL_LogPriority, const(char)*, va_list);
2268 void SDL_LogGetOutputFunction (SDL_LogOutputFunction, void**);
2269 void SDL_LogSetOutputFunction (SDL_LogOutputFunction, void*);
2271 // SDL_messagebox.h
2272 int SDL_ShowMessageBox (const(SDL_MessageBoxData)*, int*);
2273 int SDL_ShowSimpleMessageBox (uint, const(char)*, const(char)*, SDL_Window*);
2275 // SDL_mouse.h
2276 SDL_Window* SDL_GetMouseFocus ();
2277 uint SDL_GetMouseState (int*, int*);
2278 uint SDL_GetRelativeMouseState (int*, int*);
2279 void SDL_WarpMouseInWindow (SDL_Window*, int, int);
2280 int SDL_SetRelativeMouseMode (SDL_bool);
2281 SDL_bool SDL_GetRelativeMouseMode ();
2282 SDL_Cursor* SDL_CreateCursor (const(ubyte)*, const(ubyte)*, int, int, int, int);
2283 SDL_Cursor* SDL_CreateColorCursor (SDL_Surface*, int, int);
2284 SDL_Cursor* SDL_CreateSystemCursor (SDL_SystemCursor);
2285 void SDL_SetCursor (SDL_Cursor*);
2286 SDL_Cursor* SDL_GetCursor ();
2287 SDL_Cursor* SDL_GetDefaultCursor ();
2288 void SDL_FreeCursor (SDL_Cursor*);
2289 int SDL_ShowCursor (int);
2291 // SDL_pixels.h
2292 const(char)* SDL_GetPixelFormatName (uint);
2293 SDL_bool SDL_PixelFormatEnumToMasks (uint, int*, uint*, uint*, uint*, uint*);
2294 uint SDL_MasksToPixelFormatEnum (int, uint, uint, uint, uint);
2295 SDL_PixelFormat* SDL_AllocFormat (uint);
2296 void SDL_FreeFormat (SDL_PixelFormat*);
2297 SDL_Palette* SDL_AllocPalette (int);
2298 int SDL_SetPixelFormatPalette (SDL_PixelFormat*, SDL_Palette*);
2299 int SDL_SetPaletteColors (SDL_Palette*, const(SDL_Color)*, int, int);
2300 void SDL_FreePalette (SDL_Palette*);
2301 uint SDL_MapRGB (const(SDL_PixelFormat)*, ubyte, ubyte, ubyte);
2302 uint SDL_MapRGBA (const(SDL_PixelFormat)*, ubyte, ubyte, ubyte, ubyte);
2303 void SDL_GetRGB (uint, const(SDL_PixelFormat)*, ubyte*, ubyte*, ubyte*);
2304 void SDL_GetRGBA (uint, const(SDL_PixelFormat)*, ubyte*, ubyte*, ubyte*, ubyte*);
2305 void SDL_CalculateGammaRamp (float, ushort*);
2307 // SDL_platform.h
2308 const(char)* SDL_GetPlatform ();
2310 // SDL_power.h
2311 SDL_PowerState SDL_GetPowerInfo (int*, int*);
2313 // SDL_Rect.h
2314 SDL_bool SDL_HasIntersection (const(SDL_Rect)*, const(SDL_Rect)*);
2315 SDL_bool SDL_IntersectRect (const(SDL_Rect)*, const(SDL_Rect)*, SDL_Rect*);
2316 void SDL_UnionRect (const(SDL_Rect)*, const(SDL_Rect)*, SDL_Rect*);
2317 void SDL_EnclosePoints (const(SDL_Point)*, int, const(SDL_Rect)*, SDL_Rect*);
2318 SDL_bool SDL_IntersectRectAndLine (const(SDL_Rect)*, int*, int*, int*, int*);
2320 // SDL_Render.h
2321 int SDL_GetNumRenderDrivers ();
2322 int SDL_GetRenderDriverInfo (int, SDL_RendererInfo*);
2323 int SDL_CreateWindowAndRenderer (int, int, uint, SDL_Window**, SDL_Renderer**);
2324 SDL_Renderer* SDL_CreateRenderer (SDL_Window*, int, uint);
2325 SDL_Renderer* SDL_CreateSoftwareRenderer (SDL_Surface*);
2326 SDL_Renderer* SDL_GetRenderer (SDL_Window*);
2327 int SDL_GetRendererInfo (SDL_Renderer*, SDL_RendererInfo*);
2328 SDL_Texture* SDL_CreateTexture (SDL_Renderer*, uint, int, int, int);
2329 SDL_Texture* SDL_CreateTextureFromSurface (SDL_Renderer*, SDL_Surface*);
2330 int SDL_QueryTexture (SDL_Texture*, uint*, int*, int*, int*);
2331 int SDL_SetTextureColorMod (SDL_Texture*, ubyte, ubyte, ubyte);
2332 int SDL_GetTextureColorMod (SDL_Texture*, ubyte*, ubyte*, ubyte*);
2333 int SDL_SetTextureAlphaMod (SDL_Texture*, ubyte);
2334 int SDL_GetTextureAlphaMod (SDL_Texture*, ubyte*);
2335 int SDL_SetTextureBlendMode (SDL_Texture*, SDL_BlendMode);
2336 int SDL_GetTextureBlendMode (SDL_Texture*, SDL_BlendMode*);
2337 int SDL_UpdateTexture (SDL_Texture*, const(SDL_Rect)*, const(void)*, int);
2338 int SDL_UpdateYUVTexture (SDL_Texture*, const(SDL_Rect)*, const(ubyte)*, int, const(ubyte)*, int, const(ubyte)*, int);
2339 int SDL_LockTexture (SDL_Texture*, const(SDL_Rect)*, void**, int*);
2340 int SDL_UnlockTexture (SDL_Texture*);
2341 SDL_bool SDL_RenderTargetSupported (SDL_Renderer*);
2342 int SDL_SetRenderTarget (SDL_Renderer*, SDL_Texture*);
2343 SDL_Texture* SDL_GetRenderTarget (SDL_Renderer*);
2344 int SDL_RenderSetClipRect (SDL_Renderer*, const(SDL_Rect)*);
2345 void SDL_RenderGetClipRect (SDL_Renderer* renderer, SDL_Rect*);
2346 int SDL_RenderSetLogicalSize (SDL_Renderer*, int, int);
2347 void SDL_RenderGetLogicalSize (SDL_Renderer*, int*, int*);
2348 int SDL_RenderSetViewport (SDL_Renderer*, const(SDL_Rect)*);
2349 void SDL_RenderGetViewport (SDL_Renderer*, SDL_Rect*);
2350 int SDL_RenderSetScale (SDL_Renderer*, float, float);
2351 int SDL_RenderGetScale (SDL_Renderer*, float*, float*);
2352 int SDL_SetRenderDrawColor (SDL_Renderer*, ubyte, ubyte, ubyte, ubyte);
2353 int SDL_GetRenderDrawColor (SDL_Renderer*, ubyte*, ubyte*, ubyte*, ubyte*);
2354 int SDL_SetRenderDrawBlendMode (SDL_Renderer*, SDL_BlendMode);
2355 int SDL_GetRenderDrawBlendMode (SDL_Renderer*, SDL_BlendMode*);
2356 int SDL_RenderClear (SDL_Renderer*);
2357 int SDL_RenderDrawPoint (SDL_Renderer*, int, int);
2358 int SDL_RenderDrawPoints (SDL_Renderer*, const(SDL_Point)*, int);
2359 int SDL_RenderDrawLine (SDL_Renderer*, int, int, int, int);
2360 int SDL_RenderDrawLines (SDL_Renderer*, const(SDL_Point)*, int);
2361 int SDL_RenderDrawRect (SDL_Renderer*, const(SDL_Rect)*);
2362 int SDL_RenderDrawRects (SDL_Renderer*, const(SDL_Rect)*, int);
2363 int SDL_RenderFillRect (SDL_Renderer*, const(SDL_Rect)*);
2364 int SDL_RenderFillRects (SDL_Renderer*, const(SDL_Rect)*, int);
2365 int SDL_RenderCopy (SDL_Renderer*, SDL_Texture*, const(SDL_Rect)*, const(SDL_Rect*));
2366 int SDL_RenderCopyEx (SDL_Renderer*, SDL_Texture*, const(SDL_Rect)*, const(SDL_Rect)*, const(double), const(SDL_Point)*, const(SDL_RendererFlip));
2367 int SDL_RenderReadPixels (SDL_Renderer*, const(SDL_Rect)*, uint, void*, int);
2368 void SDL_RenderPresent (SDL_Renderer*);
2369 void SDL_DestroyTexture (SDL_Texture*);
2370 void SDL_DestroyRenderer (SDL_Renderer*);
2371 int SDL_GL_BindTexture (SDL_Texture*, float*, float*);
2372 int SDL_GL_UnbindTexture (SDL_Texture*);
2374 // SDL_rwops.h
2375 SDL_RWops* SDL_RWFromFile (const(char)*, const(char)*);
2376 SDL_RWops* SDL_RWFromFP (FILE*, SDL_bool);
2377 SDL_RWops* SDL_RWFromMem (void*, int);
2378 SDL_RWops* SDL_RWFromConstMem (const(void)*, int);
2379 SDL_RWops* SDL_AllocRW ();
2380 void SDL_FreeRW (SDL_RWops*);
2381 ubyte SDL_ReadU8 (SDL_RWops*);
2382 ushort SDL_ReadLE16 (SDL_RWops*);
2383 ushort SDL_ReadBE16 (SDL_RWops*);
2384 uint SDL_ReadLE32 (SDL_RWops*);
2385 uint SDL_ReadBE32 (SDL_RWops*);
2386 ulong SDL_ReadLE64 (SDL_RWops*);
2387 ulong SDL_ReadBE64 (SDL_RWops*);
2388 usize SDL_WriteU8 (SDL_RWops*, ubyte);
2389 usize SDL_WriteLE16 (SDL_RWops*, ushort);
2390 usize SDL_WriteBE16 (SDL_RWops*, ushort);
2391 usize SDL_WriteLE32 (SDL_RWops*, uint);
2392 usize SDL_WriteBE32 (SDL_RWops*, uint);
2393 usize SDL_WriteLE64 (SDL_RWops*, ulong);
2394 usize SDL_WriteBE64 (SDL_RWops*, ulong);
2396 // SDL_shape.h
2397 SDL_Window* SDL_CreateShapedWindow (const(char)*, uint, uint, uint, uint, uint);
2398 SDL_bool SDL_IsShapedWindow (const(SDL_Window)*);
2399 int SDL_SetWindowShape (SDL_Window*, SDL_Surface*, SDL_WindowShapeMode*);
2400 int SDL_GetShapedWindowMode (SDL_Window*, SDL_WindowShapeMode*);
2402 // SDL_surface.h
2403 SDL_Surface* SDL_CreateRGBSurface (uint, int, int, int, uint, uint, uint, uint);
2404 SDL_Surface* SDL_CreateRGBSurfaceFrom (void*, int, int, int, int, uint, uint, uint, uint);
2405 void SDL_FreeSurface (SDL_Surface*);
2406 int SDL_SetSurfacePalette (SDL_Surface*, SDL_Palette*);
2407 int SDL_LockSurface (SDL_Surface*);
2408 int SDL_UnlockSurface (SDL_Surface*);
2409 SDL_Surface* SDL_LoadBMP_RW (SDL_RWops*, int);
2410 int SDL_SaveBMP_RW (SDL_Surface*, SDL_RWops*, int);
2411 int SDL_SetSurfaceRLE (SDL_Surface*, int);
2412 int SDL_SetColorKey (SDL_Surface*, int, uint);
2413 int SDL_GetColorKey (SDL_Surface*, uint*);
2414 int SDL_SetSurfaceColorMod (SDL_Surface*, ubyte, ubyte, ubyte);
2415 int SDL_GetSurfaceColorMod (SDL_Surface*, ubyte*, ubyte*, ubyte*);
2416 int SDL_SetSurfaceAlphaMod (SDL_Surface*, ubyte);
2417 int SDL_GetSurfaceAlphaMod (SDL_Surface*, ubyte*);
2418 int SDL_SetSurfaceBlendMode (SDL_Surface*, SDL_BlendMode);
2419 int SDL_GetSurfaceBlendMode (SDL_Surface*, SDL_BlendMode*);
2420 SDL_bool SDL_SetClipRect (SDL_Surface*, const(SDL_Rect)*);
2421 void SDL_GetClipRect (SDL_Surface*, SDL_Rect*);
2422 SDL_Surface* SDL_ConvertSurface (SDL_Surface*, const(SDL_PixelFormat)*, uint);
2423 SDL_Surface* SDL_ConvertSurfaceFormat (SDL_Surface*, uint, uint);
2424 int SDL_ConvertPixels (int, int, uint, const(void)*, int, uint, void*, int);
2425 int SDL_FillRect (SDL_Surface*, const(SDL_Rect)*, uint);
2426 int SDL_FillRects (SDL_Surface*, const(SDL_Rect)*, int, uint);
2427 int SDL_UpperBlit (SDL_Surface*, const(SDL_Rect)*, SDL_Surface*, SDL_Rect*);
2428 int SDL_LowerBlit (SDL_Surface*, SDL_Rect*, SDL_Surface*, SDL_Rect*);
2429 int SDL_SoftStretch (SDL_Surface*, const(SDL_Rect)*, SDL_Surface*, const(SDL_Rect)*);
2430 int SDL_UpperBlitScaled (SDL_Surface*, const(SDL_Rect)*, SDL_Surface*, SDL_Rect*);
2431 int SDL_LowerBlitScaled (SDL_Surface*, SDL_Rect*, SDL_Surface*, SDL_Rect*);
2433 alias SDL_BlitSurface = SDL_UpperBlit;
2434 alias SDL_BlitScaled = SDL_UpperBlitScaled;
2436 // SDL_syswm.h
2437 SDL_bool SDL_GetWindowWMInfo (SDL_Window* window, SDL_SysWMinfo * info);
2439 // SDL_timer.h
2440 uint SDL_GetTicks ();
2441 ulong SDL_GetPerformanceCounter ();
2442 ulong SDL_GetPerformanceFrequency ();
2443 void SDL_Delay (uint);
2444 SDL_TimerID SDL_AddTimer (uint, SDL_TimerCallback, void*);
2445 SDL_bool SDL_RemoveTimer (SDL_TimerID);
2447 // SDL_touch.h
2448 int SDL_GetNumTouchDevices ();
2449 SDL_TouchID SDL_GetTouchDevice (int);
2450 int SDL_GetNumTouchFingers (SDL_TouchID);
2451 SDL_Finger* SDL_GetTouchFinger (SDL_TouchID, int);
2453 // SDL_version.h
2454 void SDL_GetVersion (SDL_version*);
2455 const(char)* SDL_GetRevision ();
2456 int SDL_GetRevisionNumber ();
2458 // SDL_video.h
2459 int SDL_GetNumVideoDrivers ();
2460 const(char)* SDL_GetVideoDriver (int);
2461 int SDL_VideoInit (const(char)*);
2462 void SDL_VideoQuit ();
2463 const(char)* SDL_GetCurrentVideoDriver ();
2464 int SDL_GetNumVideoDisplays ();
2465 const(char)* SDL_GetDisplayName (int);
2466 int SDL_GetDisplayBounds (int, SDL_Rect*);
2467 int SDL_GetNumDisplayModes (int);
2468 int SDL_GetDisplayMode (int, int, SDL_DisplayMode*);
2469 int SDL_GetDesktopDisplayMode (int, SDL_DisplayMode*);
2470 int SDL_GetCurrentDisplayMode (int, SDL_DisplayMode*);
2471 SDL_DisplayMode* SDL_GetClosestDisplayMode (int, const(SDL_DisplayMode)*, SDL_DisplayMode*);
2472 int SDL_GetWindowDisplayIndex (SDL_Window*);
2473 int SDL_SetWindowDisplayMode (SDL_Window*, const(SDL_DisplayMode)*);
2474 int SDL_GetWindowDisplayMode (SDL_Window*, SDL_DisplayMode*);
2475 uint SDL_GetWindowPixelFormat (SDL_Window*);
2476 SDL_Window* SDL_CreateWindow (const(char)*, int, int, int, int, uint);
2477 SDL_Window* SDL_CreateWindowFrom (const(void)*);
2478 uint SDL_GetWindowID (SDL_Window*);
2479 SDL_Window* SDL_GetWindowFromID (uint);
2480 uint SDL_GetWindowFlags (SDL_Window*);
2481 void SDL_SetWindowTitle (SDL_Window*, const(char)*);
2482 const(char)* SDL_GetWindowTitle (SDL_Window*);
2483 void SDL_SetWindowIcon (SDL_Window*, SDL_Surface*);
2484 void* SDL_SetWindowData (SDL_Window*, const(char)*, void*);
2485 void* SDL_GetWindowData (SDL_Window*, const(char)*);
2486 void SDL_SetWindowPosition (SDL_Window*, int, int);
2487 void SDL_GetWindowPosition (SDL_Window*, int*, int*);
2488 void SDL_SetWindowSize (SDL_Window*, int, int);
2489 void SDL_GetWindowSize (SDL_Window*, int*, int*);
2490 void SDL_SetWindowMinimumSize (SDL_Window*, int, int);
2491 void SDL_GetWindowMinimumSize (SDL_Window*, int*, int*);
2492 void SDL_SetWindowMaximumSize (SDL_Window*, int, int);
2493 void SDL_GetWindowMaximumSize (SDL_Window*, int*, int*);
2494 void SDL_SetWindowBordered (SDL_Window*, SDL_bool);
2495 void SDL_ShowWindow (SDL_Window*);
2496 void SDL_HideWindow (SDL_Window*);
2497 void SDL_RaiseWindow (SDL_Window*);
2498 void SDL_MaximizeWindow (SDL_Window*);
2499 void SDL_MinimizeWindow (SDL_Window*);
2500 void SDL_RestoreWindow (SDL_Window*);
2501 int SDL_SetWindowFullscreen (SDL_Window*, uint);
2502 SDL_Surface* SDL_GetWindowSurface (SDL_Window*);
2503 int SDL_UpdateWindowSurface (SDL_Window*);
2504 int SDL_UpdateWindowSurfaceRects (SDL_Window*, SDL_Rect*, int);
2505 void SDL_SetWindowGrab (SDL_Window*, SDL_bool);
2506 SDL_bool SDL_GetWindowGrab (SDL_Window*);
2507 int SDL_SetWindowBrightness (SDL_Window*, float);
2508 float SDL_GetWindowBrightness (SDL_Window*);
2509 int SDL_SetWindowGammaRamp (SDL_Window*, const(ushort)*, const(ushort)*, const(ushort)*, const(ushort)*);
2510 int SDL_GetWindowGammaRamp (SDL_Window*, ushort*, ushort*, ushort*, ushort*);
2511 void SDL_DestroyWindow (SDL_Window*);
2512 SDL_bool SDL_IsScreenSaverEnabled ();
2513 void SDL_EnableScreenSaver ();
2514 void SDL_DisableScreenSaver ();
2515 int SDL_GL_LoadLibrary (const(char)*);
2516 void* SDL_GL_GetProcAddress (const(char)*);
2517 void SDL_GL_UnloadLibrary ();
2518 SDL_bool SDL_GL_ExtensionSupported (const(char)*);
2519 void SDL_GL_ResetAttributes ();
2520 int SDL_GL_SetAttribute (SDL_GLattr, int);
2521 int SDL_GL_GetAttribute (SDL_GLattr, int*);
2522 SDL_GLContext SDL_GL_CreateContext (SDL_Window*);
2523 int SDL_GL_MakeCurrent (SDL_Window*, SDL_GLContext);
2524 SDL_Window* SDL_GL_GetCurrentWindow ();
2525 SDL_GLContext SDL_GL_GetCurrentContext ();
2526 void SDL_GL_GetDrawableSize (SDL_Window*, int*, int*);
2527 int SDL_GL_SetSwapInterval (int);
2528 int SDL_GL_GetSwapInterval ();
2529 void SDL_GL_SwapWindow (SDL_Window*);
2530 void SDL_GL_DeleteContext (SDL_GLContext);
2532 // SDL_filesystem.h
2533 char* SDL_GetBasePath ();
2534 char* SDL_GetPrefPath (const(char)* org, const(char)* app);
2536 // This function is not part of the public interface, but SDL expects it to
2537 // be called before any subsystems have been intiailized.
2539 // Normally, this happens via linking with libSDLmain, but since that
2540 // doesn't happen when using Derelict, then the loader must load this
2541 // function and call it before the load method returns. Otherwise, bad
2542 // things can happen.
2543 //private extern(C) nothrow @nogc alias da_SDL_SetMainReady = void function ();
2544 void SDL_SetMainReady ();
2547 nothrow:
2548 @nogc:
2549 // SDL_audio.h
2550 SDL_AudioSpec* SDL_LoadWAV (const(char)* file, SDL_AudioSpec* spec, ubyte** audio_buf, uint* len) {
2551 return SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1, spec, audio_buf, len);
2554 // SDL_events.h
2555 ubyte SDL_GetEventState (uint type) {
2556 return SDL_EventState(type, SDL_QUERY);
2559 // SDL_GameController.h
2560 int SDL_GameControllerAddMappingsFromFile (const(char)* file) {
2561 return SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile (file, "rb"), 1);
2564 // SDL_quit.h
2565 bool SDL_QuitRequested() {
2566 SDL_PumpEvents();
2567 return SDL_PeepEvents(null, 0, SDL_PEEKEVENT, SDL_QUIT, SDL_QUIT) > 0;
2570 // SDL_surface.h
2571 SDL_Surface* SDL_LoadBMP (const(char)* file) {
2572 return SDL_LoadBMP_RW(SDL_RWFromFile (file, "rb"), 1);
2575 int SDL_SaveBMP (SDL_Surface* surface, const(char)* file) {
2576 return SDL_SaveBMP_RW(surface, SDL_RWFromFile (file, "wb"), 1);
2580 // SDL_init will fail if SDL_SetMainReady has not been called.
2581 // Since there's no SDL_main on the D side, it needs to be handled
2582 // manually. My understanding that this is fine on the platforms
2583 // that D is currently available on. If we ever get on to Android
2584 // or iPhone, though, this will need to be versioned.
2585 // I've wrapped it in a try/catch because it seem the function is
2586 // not always exported on Linux. See issue #153
2587 // https://github.com/aldacron/Derelict3/issues/153
2588 shared static this () {
2589 SDL_SetMainReady();