-
Notifications
You must be signed in to change notification settings - Fork 7
/
sdl2.go
2870 lines (2261 loc) · 64.4 KB
/
sdl2.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) 2013 Tony Wilson. All rights reserved.
// See LICENCE file for permissions and restrictions.
//Package sdl2 provides the outside environment to access SDL2.dll.
package sdl2
import (
"github.com/tHinqa/outside"
. "github.com/tHinqa/outside/types"
"unsafe"
)
func init() {
outside.AddDllApis(dll, false, apiList)
}
type (
fix uintptr
Enum int
Char byte
Double float64
Float float32
Long int
Atomic struct{ Value int }
AudioCVT uint32
AudioDeviceID uint32
AudioFormat uint16
Color struct{ r, g, b, a uint8 }
Cond struct{}
CurrentBeginThread func(*Void, uint, func(*Void) uint /*arg*/, *Void, uint /*threadID*/, *uint) Uintptr
CurrentEndThread func(code uint)
Cursor struct{}
EventType uint32
FingerID int64
GameController struct{}
GestureID int64
GLContext *Void
Haptic struct{}
IconvT *struct{}
Joystick struct{}
JoystickID int32
Keycode int32
Mutex struct{}
BlitMap struct{}
Renderer struct{}
Sem struct{}
SpinLock int
Texture struct{}
Thread struct{}
ThreadFunction func(data *Void) int
ThreadIDS Unsigned_long
TimerID int
TLSID Unsigned_int
TouchID int64
Window struct{}
Size uintptr
Uintptr uint32
Unsigned_int uint
Unsigned_long int
Void struct{}
Wchar int
)
type INIT uint32
const (
INIT_TIMER INIT = 1 << iota
_
_
_
INIT_AUDIO // 0x10
INIT_VIDEO
_
_
_ // 0x100
INIT_JOYSTICK
_
_
INIT_HAPTIC // 0x1000
INIT_GAMECONTROLLER
INIT_EVENTS
_
_ // 0x10000
_
_
_
INIT_NOPARACHUTE // 0x100000
INIT_EVERYTHING = INIT_TIMER |
INIT_AUDIO | INIT_VIDEO | INIT_EVENTS |
INIT_JOYSTICK | INIT_HAPTIC |
INIT_GAMECONTROLLER
)
type Bool Enum
const (
FALSE Bool = 0
TRUE Bool = 1
)
const FIRSTEVENT EventType = 0
const (
QUIT EventType = iota + 0x100
APP_TERMINATING
APP_LOWMEMORY
APP_WILLENTERBACKGROUND
APP_DIDENTERBACKGROUND
APP_WILLENTERFOREGROUND
APP_DIDENTERFOREGROUND
)
const (
WINDOWEVENT EventType = iota + 0x200
SYSWMEVENT
)
const (
KEYDOWN EventType = iota + 0x300
KEYUP
TEXTEDITING
TEXTINPUT
)
const (
MOUSEMOTION EventType = iota + 0x400
MOUSEBUTTONDOWN
MOUSEBUTTONUP
MOUSEWHEEL
)
const (
JOYAXISMOTION EventType = iota + 0x600
JOYBALLMOTION
JOYHATMOTION
JOYBUTTONDOWN
JOYBUTTONUP
JOYDEVICEADDED
JOYDEVICEREMOVED
)
const (
CONTROLLERAXISMOTION EventType = iota + 0x650
CONTROLLERBUTTONDOWN
CONTROLLERBUTTONUP
CONTROLLERDEVICEADDED
CONTROLLERDEVICEREMOVED
CONTROLLERDEVICEREMAPPED
)
const (
FINGERDOWN EventType = iota + 0x700
FINGERUP
FINGERMOTION
)
const (
DOLLARGESTURE EventType = iota + 0x800
DOLLARRECORD
MULTIGESTURE
CLIPBOARDUPDATE EventType = 0x900
DROPFILE EventType = 0x1000
USEREVENT EventType = 0x8000
LASTEVENT EventType = 0xFFFF
)
var (
GetPlatform func() string
Malloc func(size Size) *Void
Calloc func(nmemb Size, size Size) *Void
Realloc func(mem *Void, size Size) *Void
Free func(mem *Void)
Getenv func(name string) string
Setenv func(name string, value string, overwrite int) int
Qsort func(
base *Void,
nmemb, size Size,
compare func(*Void, *Void) int)
Abs func(x int) int
Isdigit func(x int) int
Isspace func(x int) int
Toupper func(x int) int
Tolower func(x int) int
Memset func(dst *Void, c int, leng Size) *Void
Memcpy func(dst, src *Void, len Size) *Void
Memmove func(dst, src *Void, len Size) *Void
Memcmp func(s1, s2 *Void, len Size) int
Wcslen func(wstr *Wchar) Size
Wcslcpy func(dst, src *Wchar, maxlen Size) Size
Wcslcat func(dst, src *Wchar, maxlen Size) Size
Strlen func(str string) Size
Strlcpy func(dst, src string, maxlen Size) Size
Utf8strlcpy func(dst, src string, dstBytes Size) Size
Strlcat func(dst, src string, maxlen Size) Size
Strdup func(str string) string
Strrev func(str string) string
Strupr func(str string) string
Strlwr func(str string) string
Strchr func(str string, c int) string
Strrchr func(str string, c int) string
Strstr func(haystack string, needle string) string
Itoa func(value int, str string, radix int) string
Uitoa func(value Unsigned_int, str string, radix int) string
Ltoa func(value Long, str string, radix int) string
Ultoa func(value Unsigned_long, str string, radix int) string
Lltoa func(value int64, str string, radix int) string
Ulltoa func(value uint64, str string, radix int) string
Atoi func(str string) int
Atof func(str string) Double
Strtol func(str string, endp **Char, base int) Long
Strtoul func(str string, endp **Char, base int) Unsigned_long
Strtoll func(str string, endp **Char, base int) int64
Strtoull func(str string, endp **Char, base int) uint64
//TODO(t):BUG(reflect.Convert) uint64
Strtod func(str string, endp **Char) Double
Strcmp func(str1, str2 string) int
Strncmp func(str1, str2 string, maxlen Size) int
Strcasecmp func(str1, str2 string) int
Strncasecmp func(str1, str2 string, leng Size) int
Sscanf func(text string, fmt string, va ...VArg) int
Snprintf func(text *Char, maxlen Size, fmt string, va ...VArg) int
Vsnprintf func(
text string, maxlen Size, fmt string, ap VAList) int
Atan func(x Double) Double
Atan2 func(x, y Double) Double
Ceil func(x Double) Double
Copysign func(x, y Double) Double
Cos func(x Double) Double
Cosf func(x Float) Float
Fabs func(x Double) Double
Floor func(x Double) Double
Log func(x Double) Double
Pow func(x, y Double) Double
Scalbn func(x Double, n int) Double
Sin func(x Double) Double
Sinf func(x Float) Float
Sqrt func(x Double) Double
IconvOpen func(tocode, fromcode string) IconvT
IconvClose func(cd IconvT) int
Iconv func(cd IconvT, inbuf **Char, inbytesleft *Size,
outbuf **Char, outbytesleft *Size) Size
IconvString func(tocode, fromcode, inbuf string,
inbytesleft Size) string
SetMainReady func()
RegisterApp func(
name string,
style uint32,
hInst *Void) int
UnregisterApp func()
ReportAssertion func(
*AssertData, string, string, int) AssertState
SetAssertionHandler func(
handler AssertionHandler,
userdata *Void)
GetAssertionReport func() *AssertData
ResetAssertionReport func()
AtomicTryLock func(lock *SpinLock) Bool
AtomicLock func(lock *SpinLock)
AtomicUnlock func(lock *SpinLock)
AtomicCAS func(
a *Atomic,
oldval, newval int) Bool
AtomicCASPtr func(
a **Void,
oldval, newval *Void) Bool
SetError func(fmt string, va ...VArg) int
GetError func() string
ClearError func()
Error func(code Errorcode) int
CreateMutex func() *Mutex
LockMutex func(mutex *Mutex) int
TryLockMutex func(mutex *Mutex) int
UnlockMutex func(mutex *Mutex) int
DestroyMutex func(mutex *Mutex)
CreateSemaphore func(initialValue uint32) *Sem
DestroySemaphore func(sem *Sem)
SemWait func(sem *Sem) int
SemTryWait func(sem *Sem) int
SemWaitTimeout func(sem *Sem, ms uint32) int
SemPost func(sem *Sem) int
SemValue func(sem *Sem) uint32
CreateCond func() *Cond
DestroyCond func(cond *Cond)
CondSignal func(cond *Cond) int
CondBroadcast func(cond *Cond) int
CondWait func(cond *Cond, mutex *Mutex) int
CondWaitTimeout func(
cond *Cond, mutex *Mutex, ms uint32) int
CreateThread func(
fn ThreadFunction,
name string,
data *Void,
beginThread CurrentBeginThread,
endThread CurrentEndThread) *Thread
GetThreadName func(thread *Thread) string
ThreadID func() ThreadIDS
GetThreadID func(thread *Thread) ThreadIDS
SetThreadPriority func(priority ThreadPriority) int
WaitThread func(thread *Thread, status *int)
TLSCreate func() TLSID
TLSGet func(id TLSID) *Void
TLSSet func(
id TLSID, value *Void, destructor func(*Void)) int
RWFromFile func(file, mode string) *RWops
RWFromFP func(fp *Void, autoclose Bool) *RWops
RWFromMem func(mem *Void, size int) *RWops
RWFromConstMem func(mem *Void, size int) *RWops
AllocRW func() *RWops
FreeRW func(area *RWops)
ReadU8 func(src *RWops) uint8
ReadLE16 func(src *RWops) uint16
ReadBE16 func(src *RWops) uint16
ReadLE32 func(src *RWops) uint32
ReadBE32 func(src *RWops) uint32
ReadLE64 func(
src *RWops) uint64
//TODO(t):BUG(reflect.Convert) uint64
ReadBE64 func(
src *RWops) uint64
//TODO(t):BUG(reflect.Convert) uint64
WriteU8 func(dst *RWops, value uint8) Size
WriteLE16 func(dst *RWops, value uint16) Size
WriteBE16 func(dst *RWops, value uint16) Size
WriteLE32 func(dst *RWops, value uint32) Size
WriteBE32 func(dst *RWops, value uint32) Size
WriteLE64 func(dst *RWops, value uint64) Size
WriteBE64 func(dst *RWops, value uint64) Size
GetNumAudioDrivers func() int
GetAudioDriver func(index int) string
AudioInit func(driverName string) int
AudioQuit func()
GetCurrentAudioDriver func() string
OpenAudio func(desired, obtained *AudioSpec) int
GetNumAudioDevices func(iscapture int) int
GetAudioDeviceName func(index, iscapture int) string
OpenAudioDevice func(
device string,
iscapture int,
desired, obtained *AudioSpec,
allowedChanges int) AudioDeviceID
GetAudioStatus func() AudioStatus
GetAudioDeviceStatus func(
dev AudioDeviceID) AudioStatus
PauseAudio func(
pauseOn int)
PauseAudioDevice func(
dev AudioDeviceID,
pauseOn int)
LoadWAVRW func(
src *RWops,
freesrc int,
spec *AudioSpec,
audioBuf **uint8,
audioLen *uint32) *AudioSpec
FreeWAV func(
audioBuf *uint8)
BuildAudioCVT func(
cvt *AudioCVT,
srcFormat AudioFormat,
srcChannels uint8,
srcRate int,
dstFormat AudioFormat,
dstChannels uint8,
dstRate int) int
ConvertAudio func(
cvt *AudioCVT) int
MixAudio func(
dst, src *uint8,
len uint32,
volume int)
MixAudioFormat func(
dst, src *uint8,
format AudioFormat,
len uint32,
volume int)
LockAudio func()
LockAudioDevice func(dev AudioDeviceID)
UnlockAudio func()
UnlockAudioDevice func(dev AudioDeviceID)
CloseAudio func()
CloseAudioDevice func(dev AudioDeviceID)
//TODO(t):Figure out why this crashes
SetClipboardText func(text string) int
GetClipboardText func() string
HasClipboardText func() Bool
GetCPUCount func() int
GetCPUCacheLineSize func() int
HasRDTSC func() Bool
HasAltiVec func() Bool
HasMMX func() Bool
Has3DNow func() Bool
HasSSE func() Bool
HasSSE2 func() Bool
HasSSE3 func() Bool
HasSSE41 func() Bool
HasSSE42 func() Bool
GetPixelFormatName func(format uint32) string
PixelFormatEnumToMasks func(
format uint32,
bpp *int,
Rmask, Gmask, Bmask, Amask *uint32) Bool
MasksToPixelFormatEnum func(
bpp int, Rmask, Gmask, Bmask, Amask uint32) uint32
AllocFormat func(pixelFormat uint32) *PixelFormat
FreeFormat func(format *PixelFormat)
AllocPalette func(ncolors int) *Palette
SetPixelFormatPalette func(
format *PixelFormat, palette *Palette) int
SetPaletteColors func(
palette *Palette,
colors *Color,
firstcolor, ncolors int) int
FreePalette func(palette *Palette)
MapRGB func(
format *PixelFormat, r, g, b uint8) uint32
MapRGBA func(
format *PixelFormat, r, g, b, a uint8) uint32
GetRGB func(
pixel uint32, format *PixelFormat, r, g, b *uint8)
GetRGBA func(
pixel uint32, format *PixelFormat, r, g, b, a *uint8)
CalculateGammaRamp func(gamma Float, ramp *uint16)
HasIntersection func(A, B *Rect) Bool
IntersectRect func(A, B, result *Rect) Bool
UnionRect func(A, B, result *Rect)
EnclosePoints func(
points *Point,
count int,
clip, result *Rect) Bool
IntersectRectAndLine func(
rect *Rect, X1, Y1, X2, Y2 *int) Bool
CreateRGBSurface func(
flags uint32,
width, height, depth int,
Rmask, Gmask, Bmask, Amask uint32) *Surface
CreateRGBSurfaceFrom func(
pixels *Void,
width, height, depth, pitch int,
Rmask, Gmask, Bmask, Amask uint32) *Surface
FreeSurface func(surface *Surface)
SetSurfacePalette func(
surface *Surface, palette *Palette) int
LockSurface func(surface *Surface) int
UnlockSurface func(surface *Surface)
LoadBMPRW func(
src *RWops, freesrc int) *Surface
SaveBMPRW func(
surface *Surface, dst *RWops, freedst int) int
SetSurfaceRLE func(surface *Surface, flag int) int
SetColorKey func(
surface *Surface, flag Bool, key uint32) int
// flag was int
GetColorKey func(
surface *Surface, key *uint32) int
SetSurfaceColorMod func(
surface *Surface, r, g, b uint8) int
GetSurfaceColorMod func(
surface *Surface, r, g, b *uint8) int
SetSurfaceAlphaMod func(
surface *Surface, alpha uint8) int
GetSurfaceAlphaMod func(
surface *Surface, alpha *uint8) int
SetSurfaceBlendMode func(
surface *Surface, blendMode BlendMode) int
GetSurfaceBlendMode func(
surface *Surface, blendMode *BlendMode) int
SetClipRect func(
surface *Surface, rect *Rect) Bool
GetClipRect func(
surface *Surface, rect *Rect)
ConvertSurface func(
src *Surface,
fmt *PixelFormat,
flags uint32) *Surface
ConvertSurfaceFormat func(
src *Surface,
pixelFormat uint32,
flags uint32) *Surface
ConvertPixels func(
width, height int,
srcFormat uint32,
src *Void,
srcPitch int,
dstFormat uint32,
dst *Void,
dstPitch int) int
FillRect func(
dst *Surface, rect *Rect, color uint32) int
FillRects func(
dst *Surface,
rects *Rect,
count int,
color uint32) int
UpperBlit func(
src *Surface, srcrect *Rect,
dst *Surface, dstrect *Rect) int
LowerBlit func(
src *Surface, srcrect *Rect,
dst *Surface, dstrect *Rect) int
SoftStretch func(
src *Surface, srcrect *Rect,
dst *Surface, dstrect *Rect) int
UpperBlitScaled func(
src *Surface, srcrect *Rect,
dst *Surface, dstrect *Rect) int
LowerBlitScaled func(
src *Surface, srcrect *Rect,
dst *Surface, dstrect *Rect) int
GetNumVideoDrivers func() int
GetVideoDriver func(index int) string
VideoInit func(driverName string) int
VideoQuit func()
GetCurrentVideoDriver func() string
GetNumVideoDisplays func() int
GetDisplayName func(displayIndex int) string
GetDisplayBounds func(
displayIndex int, rect *Rect) int
GetNumDisplayModes func(displayIndex int) int
GetDisplayMode func(
displayIndex, modeIndex int,
mode *DisplayMode) int
GetDesktopDisplayMode func(
displayIndex int, mode *DisplayMode) int
GetCurrentDisplayMode func(
displayIndex int, mode *DisplayMode) int
GetClosestDisplayMode func(
displayIndex int,
mode *DisplayMode,
closest *DisplayMode) *DisplayMode
GetWindowDisplayIndex func(window *Window) int
SetWindowDisplayMode func(
window *Window, mode *DisplayMode) int
GetWindowDisplayMode func(
window *Window, mode *DisplayMode) int
GetWindowPixelFormat func(window *Window) uint32
CreateWindow func(
title string,
x, y, w, h int,
flags uint32) *Window
CreateWindowFrom func(data *Void) *Window
GetWindowID func(window *Window) uint32
GetWindowFromID func(id uint32) *Window
GetWindowFlags func(window *Window) uint32
SetWindowTitle func(
window *Window, title string)
GetWindowTitle func(window *Window) string
SetWindowIcon func(
window *Window, icon *Surface)
SetWindowData func(
window *Window, name string, userdata *Void) *Void
GetWindowData func(window *Window, name string) *Void
SetWindowPosition func(window *Window, x, y int)
GetWindowPosition func(window *Window, x, y *int)
SetWindowSize func(window *Window, w, h int)
GetWindowSize func(window *Window, w, h *int)
SetWindowMinimumSize func(
window *Window, minW, minH int)
GetWindowMinimumSize func(
window *Window, w, h *int)
SetWindowMaximumSize func(
window *Window, maxW, maxH int)
GetWindowMaximumSize func(
window *Window, w, h *int)
SetWindowBordered func(
window *Window, bordered Bool)
ShowWindow func(window *Window)
HideWindow func(window *Window)
RaiseWindow func(window *Window)
MaximizeWindow func(window *Window)
MinimizeWindow func(window *Window)
RestoreWindow func(window *Window)
SetWindowFullscreen func(
window *Window, flags uint32) int
GetWindowSurface func(window *Window) *Surface
UpdateWindowSurface func(window *Window) int
UpdateWindowSurfaceRects func(
window *Window, rects *Rect, numrects int) int
SetWindowGrab func(window *Window, grabbed Bool)
GetWindowGrab func(window *Window) Bool
SetWindowBrightness func(
window *Window, brightness Float) int
GetWindowBrightness func(window *Window) Float
SetWindowGammaRamp func(
window *Window, red, green, blue *uint16) int
GetWindowGammaRamp func(
window *Window, red, green, blue *uint16) int
DestroyWindow func(window *Window)
IsScreenSaverEnabled func() Bool
EnableScreenSaver func()
DisableScreenSaver func()
GLLoadLibrary func(path string) int
GLGetProcAddress func(proc string) *Void
GLUnloadLibrary func()
GLExtensionSupported func(extension string) Bool
GLSetAttribute func(attr GLattr, value int) int
GLGetAttribute func(attr GLattr, value *int) int
GLCreateContext func(window *Window) GLContext
GLMakeCurrent func(
window *Window, context GLContext) int
GLGetCurrentWindow func() *Window
GLGetCurrentContext func() GLContext
GLSetSwapInterval func(interval int) int
GLGetSwapInterval func() int
GLSwapWindow func(window *Window)
GLDeleteContext func(context GLContext)
GetKeyboardFocus func() *Window
GetKeyboardState func(numkeys *int) *uint8
GetModState func() Keymod
SetModState func(modstate Keymod)
GetKeyFromScancode func(
scancode Scancode) Keycode
GetScancodeFromKey func(key Keycode) Scancode
GetScancodeName func(scancode Scancode) string
GetScancodeFromName func(name string) Scancode
GetKeyName func(key Keycode) string
GetKeyFromName func(name string) Keycode
StartTextInput func()
IsTextInputActive func() Bool
StopTextInput func()
SetTextInputRect func(rect *Rect)
HasScreenKeyboardSupport func() Bool
IsScreenKeyboardShown func(window *Window) Bool
GetMouseFocus func() *Window
GetMouseState func(x, y *int) uint32
GetRelativeMouseState func(x, y *int) uint32
WarpMouseInWindow func(window *Window, x, y int)
SetRelativeMouseMode func(enabled Bool) int
GetRelativeMouseMode func() Bool
CreateCursor func(
data, mask *uint8, w, h, hotX, hotY int) *Cursor
CreateColorCursor func(
surface *Surface, hotX, hotY int) *Cursor
CreateSystemCursor func(id SystemCursor) *Cursor
SetCursor func(cursor *Cursor)
GetCursor func() *Cursor
GetDefaultCursor func() *Cursor
FreeCursor func(cursor *Cursor)
ShowCursor func(toggle int) int
NumJoysticks func() int
JoystickNameForIndex func(deviceIndex int) string
JoystickOpen func(deviceIndex int) *Joystick
JoystickName func(joystick *Joystick) string
JoystickGetDeviceGUID func(
deviceIndex int) JoystickGUID
JoystickGetGUID func(
joystick *Joystick) JoystickGUID
JoystickGetGUIDString func(
guid JoystickGUID, GUID string, sGUID int)
JoystickGetGUIDFromString func(
pchGUID string) JoystickGUID
JoystickGetAttached func(
joystick *Joystick) Bool
JoystickInstanceID func(
joystick *Joystick) JoystickID
JoystickNumAxes func(joystick *Joystick) int
JoystickNumBalls func(joystick *Joystick) int
JoystickNumHats func(joystick *Joystick) int
JoystickNumButtons func(joystick *Joystick) int
JoystickUpdate func()
JoystickEventState func(state int) int
JoystickGetAxis func(
joystick *Joystick, axis int) int16
JoystickGetHat func(
joystick *Joystick, hat int) uint8
JoystickGetBall func(
joystick *Joystick, ball int, dx, dy *int) int
JoystickGetButton func(
joystick *Joystick, button int) uint8