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
|
extern fn SDL_Init() int;
extern fn SDL_Quit() void;
extern fn SDL_GetError() *const u8;
extern fn SDL_Delay(u32) void;
struct SDL_Window;
extern fn SDL_CreateWindow(title *const u8, x int, y int, w int, h int, flags u32) *SDL_Window;
extern fn SDL_DestroyWindow(*SDL_Window) void;
struct SDL_PixelFormat;
struct SDL_BlitMap;
struct SDL_Rect {
x int, y int, w int, h int
}
struct SDL_Surface {
_flags u32,
format *SDL_PixelFormat,
w int, h int,
pitch int,
pixels *void,
userdata *void,
_locked intbool,
_lock_data *void,
clip_rect SDL_Rect,
_map *SDL_BlitMap,
refcount int,
}
extern fn SDL_CreateRGBSurface(
flags u32, width int, height int, depth int, Rmask u32, Gmask u32, Bmask u32, Amask u32
) *SDL_Surface;
extern fn SDL_GetWindowSurface(*SDL_Window) *SDL_Surface;
extern fn SDL_UpdateWindowSurface(*SDL_Window) int;
extern fn SDL_UpperBlit(src *SDL_Surface, srcrect *SDL_Rect, dst *SDL_Surface, dstrect *SDL_Rect) int;
union SDL_Event {
t enum { quit = 0x100 },
_pad [8]f64, // idc exactly how big this union is but this should suffice
}
extern fn SDL_PollEvent(evt *SDL_Event) intbool;
extern fn SDL_QueueAudio(dev int, data *const void, len u32) int;
|