1
Fork 0

odin(sdl-opengl-rendering): basic line rendering

This commit is contained in:
prescientmoon 2025-06-03 03:57:19 +02:00
parent 5c5cd55904
commit 30772e4255
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
11 changed files with 253 additions and 136 deletions
odin/sdl-opengl-rendering

View file

@ -2,74 +2,42 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
odin.url = "github:starlitcanopy/odin";
odin.inputs.nixpkgs.follows = "nixpkgs";
odin.inputs.flake-utils.follows = "flake-utils";
ols.url = "github:starlitcanopy/ols";
ols.inputs.nixpkgs.follows = "nixpkgs";
ols.inputs.flake-utils.follows = "flake-utils";
ols.inputs.odin.follows = "odin";
};
outputs =
inputs:
{
overlays.default = final: prev: {
# {{{ Odin
odin = prev.odin.overrideAttrs (_: {
version = "unstable-2025-03-28";
src = final.fetchFromGitHub {
owner = "starlitcanopy";
repo = "Odin";
rev = "a1fc243f8df8b510e6de4f5e115fbfc09371cb9d";
sha256 = "0fb8lk47nb7ln0skjn3lyfi499q3wlnzp6w3qc4wf4s5zj43d6zh";
};
});
# }}}
# {{{ OLS
ols = prev.ols.overrideAttrs (_: {
version = "unstable-2025-03-12";
src = final.fetchFromGitHub {
owner = "DanielGavin";
repo = "ols";
rev = "1e44e3d78ad8a74ef09c7f54a6f6d3f7df517f8e";
sha256 = "16f7b8ijcaj5m2bdgbbl1q1mzgpgzzazrap2g17hkgy63aqq8qmf";
};
installPhase = ''
runHook preInstall
install -Dm755 ols odinfmt -t $out/bin/
cp -r builtin $out/bin/
wrapProgram $out/bin/ols --set-default ODIN_ROOT ${final.odin}/share
runHook postInstall
'';
});
# }}}
};
}
// inputs.flake-utils.lib.eachSystem (with inputs.flake-utils.lib.system; [ x86_64-linux ]) (
inputs.flake-utils.lib.eachSystem (with inputs.flake-utils.lib.system; [ x86_64-linux ]) (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system}.extend inputs.self.overlays.default;
cross = import inputs.nixpkgs {
localSystem = system;
crossSystem.config = "x86_64-w64-mingw32";
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.odin.overlays.default
inputs.ols.overlays.default
];
};
inherit (pkgs) lib;
in
{
packages = {
inherit (pkgs) odin;
gcc = cross.callPackage (import ./gcc.nix) { };
libgl = cross.libGL;
};
# {{{ Shell
devShell = pkgs.mkShell rec {
nativeBuildInputs = [
pkgs.pkg-config
pkgs.entr # File change detection
pkgs.odin # Compiler
pkgs.mold # Linker
pkgs.ols # Language server
pkgs.just # Script runner
pkgs.samply # Profiler
pkgs.ols # Language server
pkgs.gdb # Debugger
pkgs.seer # Debugger GUI
pkgs.valgrind # Detect memory leaks