Compare commits

...

2 Commits

Author SHA1 Message Date
6a86324f53 add octree library dependency 2026-02-22 19:42:57 +01:00
768a7eaf82 implement operator<< for ryalib vectors 2026-02-22 19:42:48 +01:00
2 changed files with 38 additions and 0 deletions

View File

@ -78,6 +78,25 @@ rec {
];
};
octree = stdenv.mkDerivation {
pname = "octree";
version = "2.5-unstable-2025-12-18";
src = pkgs.fetchFromGitHub {
owner = "attcs";
repo = "octree";
rev = "5058b3090c8b88e405fe2bfddd6c1c872f2b79d2";
hash = "sha256-a/aDGQ7cj1GbCjts2s9VEaxyFnL6PF+xJOsSxm9o+4M=";
};
# Header-only library
dontBuild = true;
installPhase = ''
mkdir -p $out/include
mv ./*.h $out/include/
'';
};
# ===========================================================================================
# Specify dependencies
# https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-overview
@ -120,6 +139,7 @@ rec {
# boost
# sfml
raylib
octree
llvmPackages.openmp # not required for compilation but for clangd to find the headers
# raylib-cpp
# tinyobjloader

18
include/util.hpp Normal file
View File

@ -0,0 +1,18 @@
#ifndef __UTIL_HPP_
#define __UTIL_HPP_
#include <iostream>
#include <raylib.h>
#include <raymath.h>
inline std::ostream &operator<<(std::ostream &os, const Vector2 &v) {
os << "(" << v.x << ", " << v.y << ")";
return os;
}
inline std::ostream &operator<<(std::ostream &os, const Vector3 &v) {
os << "(" << v.x << ", " << v.y << ", " << v.z << ")";
return os;
}
#endif