diff options
Diffstat (limited to 'sdl.myr')
| -rw-r--r-- | sdl.myr | 64 |
1 files changed, 42 insertions, 22 deletions
@@ -1,36 +1,56 @@ use std pkg sdl = - const INIT_VIDEO : uint32 = 32 - - extern const init : (flags : uint32 -> int) - extern const quit : (-> void) + const INIT_VIDEO : uint32 = 32 - type win = void# + extern const init : (flags : uint32 -> int) + extern const quit : (-> void) - const WIN_POS_UNSPEC : int = 536805376 - const WIN_OPENGL : uint32 = 2 + type win = void# - extern const mkwin : (title : byte#, x : int, y : int, w : int, h : int, flags : uint32 -> win) - extern const freewin : (win : win -> void) + const WIN_POS_UNSPEC : int = 536805376 + const WIN_OPENGL : uint32 = 2 - type renderer = void# + extern const mkwin : (title : byte#, x : int, y : int, w : int, h : int, flags : uint32 -> win) + extern const freewin : (win : win -> void) - const RENDERER_ACCEL : uint32 = 2 + type renderer = void# - 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) + const RENDERER_ACCEL : uint32 = 2 - type texture = void# + 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) - const PIXFMT_RGB332 : uint32 = 336660481 - const TEXACCESS_STREAM : int = 1 + type texture = void# - 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) + const PIXFMT_RGB332 : uint32 = 336660481 + const TEXACCESS_STREAM : int = 1 - extern const delay : (ms : uint32 -> void) + 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]#) ;; |