summaryrefslogtreecommitdiff
path: root/sdl.myr
blob: bcbc166356c009b8524f6c3589c53264ea7caeea (plain)
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
use std

pkg sdl =
	const INIT_VIDEO : uint32 = 32

	extern const init : (flags : uint32 -> int)
	extern const quit : (-> void)

	type win = void#

	const WIN_POS_UNSPEC : int = 536805376
	const WIN_OPENGL : uint32 = 2

	extern const mkwin : (title : byte#, x : int, y : int, w : int, h : int, flags : uint32 -> win)
	extern const freewin : (win : win -> void)

	type renderer = void#

	const RENDERER_ACCEL : uint32 = 2

	extern const mkrenderer : (win : win, index : int, flags: uint32 -> renderer)
	extern const copy : (r : renderer, tex : texture -> int)
	extern const present : (r : renderer -> void)
	extern const freerenderer : (r : renderer -> void)

	type texture = void#

	const PIXFMT_RGB332 : uint32 = 336660481
	const TEXACCESS_STREAM : int = 1

	extern const mktexture : (r : renderer, fmt : uint32, access : int, w : int, h : int -> texture)
	extern const update : (tex : texture, pixels : void#, pitch : int -> int)
	extern const freetexture : (tex : texture -> void)

	extern const delay : (ms : uint32 -> void)

	const SCANCODE_1 : uint8 = 30
	const SCANCODE_2 : uint8 = 31
	const SCANCODE_3 : uint8 = 32
	const SCANCODE_4 : uint8 = 33
	const SCANCODE_Q : uint8 = 20
	const SCANCODE_W : uint8 = 26
	const SCANCODE_E : uint8 = 8
	const SCANCODE_R : uint8 = 21
	const SCANCODE_A : uint8 = 4
	const SCANCODE_S : uint8 = 22
	const SCANCODE_D : uint8 = 7
	const SCANCODE_F : uint8 = 9
	const SCANCODE_Z : uint8 = 29
	const SCANCODE_X : uint8 = 27
	const SCANCODE_C : uint8 = 6
	const SCANCODE_V : uint8 = 25
	const SCANCODE_ESC : uint8 = 41

	extern const getkbd : ( -> uint8[256]#)
;;