Reorganise files
@ -1 +1,6 @@
|
|||||||
TODO
|
### Odin Language Bindings
|
||||||
|
|
||||||
|
This directory contains bindings for the [Odin](odin-lang.org) programming language, as well as an example implementation of the [clay website](https://nicbarker.com/clay) in Odin.
|
||||||
|
|
||||||
|
If you haven't taken a look at the [full documentation for clay](https://github.com/nicbarker/clay/blob/main/README.md), it's recommended that you take a look there first to familiarise yourself with the general concepts. This README is abbreviated and applies to using clay in Odin specifically.
|
||||||
|
|
||||||
|
@ -20,10 +20,7 @@ String :: struct {
|
|||||||
chars: [^]c.char,
|
chars: [^]c.char,
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 :: struct {
|
Vector2 :: [2]c.float
|
||||||
x: c.float,
|
|
||||||
y: c.float,
|
|
||||||
}
|
|
||||||
|
|
||||||
Dimensions :: struct {
|
Dimensions :: struct {
|
||||||
width: c.float,
|
width: c.float,
|
||||||
@ -44,12 +41,7 @@ BoundingBox :: struct {
|
|||||||
height: c.float,
|
height: c.float,
|
||||||
}
|
}
|
||||||
|
|
||||||
Color :: struct {
|
Color :: [4]c.float
|
||||||
r: c.float,
|
|
||||||
g: c.float,
|
|
||||||
b: c.float,
|
|
||||||
a: c.float,
|
|
||||||
}
|
|
||||||
|
|
||||||
CornerRadius :: struct {
|
CornerRadius :: struct {
|
||||||
topLeft: c.float,
|
topLeft: c.float,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import clay "clay-odin"
|
import clay "../../clay-odin"
|
||||||
import "core:c"
|
import "core:c"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
import "vendor:raylib"
|
import "vendor:raylib"
|
||||||
@ -307,7 +307,7 @@ DeclarativeSyntaxPageMobile :: proc() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ColorLerp :: proc(a: clay.Color, b: clay.Color, amount: f32) -> clay.Color {
|
ColorLerp :: proc(a: clay.Color, b: clay.Color, amount: f32) -> clay.Color {
|
||||||
return clay.Color{r = a.r + (b.r - a.r) * amount, g = a.g + (b.g - a.g) * amount, b = a.b + (b.b - a.b) * amount, a = a.a + (b.a - a.a) * amount}
|
return clay.Color{a.r + (b.r - a.r) * amount, a.g + (b.g - a.g) * amount, a.b + (b.b - a.b) * amount, a.a + (b.a - a.a) * amount}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOREM_IPSUM_TEXT: clay.String = clay.MakeString("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")
|
LOREM_IPSUM_TEXT: clay.String = clay.MakeString("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")
|
@ -1,6 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import clay "clay-odin"
|
import clay "../../clay-odin"
|
||||||
import "core:math"
|
import "core:math"
|
||||||
import "vendor:raylib"
|
import "vendor:raylib"
|
||||||
|
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |