diff options
author | San Jacobs | 2025-09-03 00:08:07 +0200 |
---|---|---|
committer | San Jacobs | 2025-09-03 00:08:07 +0200 |
commit | 3c0da12dae198a87c3dac196ea34e7ccc8c7dc32 (patch) | |
tree | c53e323b3f64b64fe905c66e9eaa2b58468b8ba4 | |
download | tafl-3c0da12dae198a87c3dac196ea34e7ccc8c7dc32.tar.gz tafl-3c0da12dae198a87c3dac196ea34e7ccc8c7dc32.tar.bz2 tafl-3c0da12dae198a87c3dac196ea34e7ccc8c7dc32.zip |
tafl begins
-rw-r--r-- | build.bat | 1 | ||||
-rw-r--r-- | src/tafl.odin | 69 |
2 files changed, 70 insertions, 0 deletions
diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..141af62 --- /dev/null +++ b/build.bat @@ -0,0 +1 @@ +odin run src/ -debug -out:main.out
\ No newline at end of file diff --git a/src/tafl.odin b/src/tafl.odin new file mode 100644 index 0000000..6ffc2e8 --- /dev/null +++ b/src/tafl.odin @@ -0,0 +1,69 @@ +package tafl + +import "core:fmt" +import rl "vendor:raylib" + +tafl_elements : [1024]Tafl_Element +tafl_stack : [1024]int +tafl_stack_depth : int + +main :: proc() { + + tafl() + +} + + +@(deferred_none=__tafl_close) +tafl :: proc( + width : int = 0, + height : int = 0, + x : int = 0, + y : int = 0, + sizing_width : Sizing_Dimension = {.FIT, 0, 0}, + sizing_height : Sizing_Dimension = {.FIT, 0, 0}, + layout : Layout = .LEFT_TO_RIGHT, + padding : Sides = {0,0,0,0}, + child_gap : int = 0, + ) { + + fmt.println("Opened tafl") + +} + +__tafl_close :: proc() { + + fmt.println("Closed tafl") + +} + + +Sizing_Dimension :: struct { + type : enum{ + FIT, + GROW, + FIXED + }, + min, max : int +} + +Layout :: enum { + LEFT_TO_RIGHT, + TOP_TO_BOTTOM, +} + +Sides :: struct { + top, bottom, left, right : int +} + +Tafl_Element :: struct { + width, height : int, + x, y : int, + sizing : struct { + width : Sizing_Dimension, + height : Sizing_Dimension, + }, + layout : Layout, + padding : Sides, + child_gap : int, +}
\ No newline at end of file |