aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.bat1
-rw-r--r--src/tafl.odin69
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