aboutsummaryrefslogtreecommitdiff
path: root/sdl2/pixels.ha
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2021-12-09 14:36:32 +0100
committerDrew DeVault <sir@cmpwn.com>2021-12-09 14:36:32 +0100
commit07046a3b2c2d0b6a5dfaaab70e5ea71e8334df1b (patch)
treee134285c86f6052b9c19ae7755acafa0137e215b /sdl2/pixels.ha
parentAdd README.md (diff)
downloadhare-chip8-07046a3b2c2d0b6a5dfaaab70e5ea71e8334df1b.tar.gz
sdl2::image: initial commit
Some additional things which were needed to make this work were also added.
Diffstat (limited to 'sdl2/pixels.ha')
-rw-r--r--sdl2/pixels.ha38
1 files changed, 38 insertions, 0 deletions
diff --git a/sdl2/pixels.ha b/sdl2/pixels.ha
new file mode 100644
index 0000000..8227067
--- /dev/null
+++ b/sdl2/pixels.ha
@@ -0,0 +1,38 @@
+// TODO: Flesh me out
+
+export type color = struct {
+ r: u8,
+ g: u8,
+ b: u8,
+ a: u8,
+};
+
+export type palette = struct {
+ ncolors: int,
+ colors: *color,
+ version: u32,
+ refcount: int,
+};
+
+// Note: Everything in the pixel format structure is read-only.
+export type pixelformat = struct {
+ format: u32, // TODO
+ palette: *palette,
+ bitsperpixel: u8,
+ bytesperpixel: u8,
+ padding: [2]u8,
+ rmask: u32,
+ gmask: u32,
+ bmask: u32,
+ amask: u32,
+ rloss: u8,
+ gloss: u8,
+ bloss: u8,
+ aloss: u8,
+ rshift: u8,
+ gshift: u8,
+ bshift: u8,
+ ashift: u8,
+ refcount: int,
+ next: nullable *pixelformat,
+};