Skip to content

Instantly share code, notes, and snippets.

View ftphikari's full-sized avatar

ftphikari

  • Kharkiv, Ukraine
View GitHub Profile
@ftphikari
ftphikari / atlas_packer.odin
Created February 7, 2023 21:23
Generic atlas packer
package atlas_packer
import "core:runtime"
Node :: struct {
child: [2]^Node,
pos: [2]uint,
size: [2]uint,
full: bool,
}
@ftphikari
ftphikari / radix.odin
Last active January 23, 2023 19:43
Radix sort for Odin
package radix
/*
NOTE:
This radix implementation requires a slice of uniformly signed integers, either all negative or all positive.
There is a check for type being unsigned, because most likely you do not want to sort a slice of negative numbers.
In case you do - you can remove that check.
In non-optimized build radix sort is more or less the same speed as default sort for 64bit integers.
In optimized build radix sort is twice as fast as default sort for 64bit integers (on my computer).