diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2020-01-01 12:38:35 -0500 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2020-01-01 12:59:36 -0500 |
| commit | 4d42144c4dc35a8e7e7ce544e90b34eb440ed1c5 (patch) | |
| tree | 0e150434928c1fdf2446ad8cd8d77cdac5aef892 /sdl.myr | |
| parent | bf47e7499c649c55ef1045738b0ba5c163701500 (diff) | |
Add initial SDL bindings.
Diffstat (limited to 'sdl.myr')
| -rw-r--r-- | sdl.myr | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ +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) +;; |