commit 715fdbb7c1553ebfd6fe72e4c8f2d68bc291c3c3 Author: Riyyi Date: Tue Aug 25 21:43:02 2026 +0200 Initial commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e29c8ce Binary files /dev/null and b/.DS_Store differ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..21034b5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sindri/vendor/gram"] + path = vendor/gram + url = https://github.com/riyyi/gram.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..3363b28 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Sindri + +Game engine. + +## Usage + + TODO + +## Compiling + +### Dependencies + +- `odin` +- `sh` a POSIX compatible shell + +### Building + +```sh +./build.sh +./build.sh debug +``` + +## Contributing + +Make sure to enable git hooks: + +```sh +git config core.hooksPath scripts +``` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..31ca658 --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +PROJECT="sindri" +VERSION="dev-$(date -u '+%Y-%m-%d')-$(git rev-parse --short HEAD)" + +mkdir -p build + +if [ "$1" = "debug" ]; then + shift + + odin build src/ -show-timings -collection:src=src -out:build/$PROJECT -microarch:native -use-separate-modules -define:VERSION="$VERSION-debug" -debug "$@" + exit 0 +fi + +odin build src/ -show-timings -collection:src=src -out:build/$PROJECT -microarch:native -o:speed -define:VERSION="$VERSION" "$@" diff --git a/fmt.sh b/fmt.sh new file mode 100755 index 0000000..888ef0e --- /dev/null +++ b/fmt.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +odinfmt -w src/ > /dev/null +# odinfmt -w tests/ > /dev/null diff --git a/odinfmt.json b/odinfmt.json new file mode 100644 index 0000000..ff28670 --- /dev/null +++ b/odinfmt.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/odinfmt.schema.json", + "align_struct_fields": true, + "align_struct_values": true, + "character_width": 80, + "indent_cases": true, + "newline_limit": 1, + "newline_style": "LF", + "sort_imports": true, + "space_single_line_blocks": true, + "tabs": true, + "tabs_width": 4 +} diff --git a/ols.json b/ols.json new file mode 100644 index 0000000..3b36b1e --- /dev/null +++ b/ols.json @@ -0,0 +1,8 @@ +{ + "collections": [ + { + "name": "src", + "path": "src" + } + ] +} \ No newline at end of file diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100755 index 0000000..5038022 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,18 @@ +#!/bin/sh + +SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd) + +git stash push --keep-index --quiet + +"$SCRIPT_DIR/../fmt.sh" + +if ! git diff --quiet; then + echo "Formatting changed staged files; commit aborted." + git checkout -- "$SCRIPT_DIR/.." + git stash pop --quiet + exit 1 +fi + +# "$SCRIPT_DIR/../test.sh" + +git stash pop --quiet diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/main.odin b/src/main.odin new file mode 100644 index 0000000..db97920 --- /dev/null +++ b/src/main.odin @@ -0,0 +1,11 @@ +package main + +import "core:fmt" + +VERSION :: #config(VERSION, "dev") + +// ----------------------------------------- + +main :: proc() { + fmt.println("hello world!") +} diff --git a/vendor/.DS_Store b/vendor/.DS_Store new file mode 100644 index 0000000..5cf16d1 Binary files /dev/null and b/vendor/.DS_Store differ diff --git a/vendor/gram b/vendor/gram new file mode 160000 index 0000000..0219d56 --- /dev/null +++ b/vendor/gram @@ -0,0 +1 @@ +Subproject commit 0219d56dc20946653588ec5b91d371805c023336