aboutsummaryrefslogtreecommitdiff
path: root/src/tafl.odin
blob: 6ffc2e8f662322319805e0fe044eb672b612ac2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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,
}