Skip to content

Instantly share code, notes, and snippets.

// A simple port of polymur-hash into JAI.
/*
PolymurHash version 2.0
Copyright (c) 2023 Orson Peters
This software is provided 'as-is', without any express or implied warranty. In
no event will the authors be held liable for any damages arising from the use of
this software.
@DaseinPhaos
DaseinPhaos / OAlloc.jai
Last active January 25, 2025 16:59
Port of [OffsetAllocator](https://github.com/sebbbi/OffsetAllocator) by (C) Sebastian Aaltonen 2023 in JAI
/*
Port of [OffsetAllocator](https://github.com/sebbbi/OffsetAllocator) by (C) Sebastian Aaltonen 2023
MIT License
Copyright (c) 2023 Sebastian Aaltonen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@DaseinPhaos
DaseinPhaos / jis_fix.jai
Created November 17, 2024 07:24
Utility to fix garbled filenames in directories containing Japanese files from mishandled Shift-JIS encoded archives.
#import "Basic";
#import "Windows";
#import "Windows_Utf8";
#import "File";
#import "File_Utilities";
#import "String";
main :: () {
argc : s32;
argv := CommandLineToArgvW(GetCommandLineW(), *argc);
@DaseinPhaos
DaseinPhaos / hot_reload.odin
Last active July 2, 2022 09:59
demonstrates how to hot reload config files on debug builds with odin
package hot_reload
when ODIN_DEBUG==true {
import "core:path/filepath"
import "core:os"
import "core:sync"
import "core:time"
import "core:strings"
import "core:thread"
}
import "core:fmt"
@DaseinPhaos
DaseinPhaos / d3d12shader.odin
Created May 23, 2022 06:36
DirectXShaderCompiler bindings for Odin
package dxc
import d3d12 "vendor:directx/d3d12"
SHADER_VERSION_TYPE :: enum u32 {
PIXEL_SHADER = 0,
VERTEX_SHADER = 1,
GEOMETRY_SHADER = 2,
HULL_SHADER = 3,
DOMAIN_SHADER = 4,
COMPUTE_SHADER = 5,
@DaseinPhaos
DaseinPhaos / d3d11_triangle.odin
Created April 29, 2022 18:23
Minimal d3d11 triangles using Odin
// reference: https://gist.github.com/msmshazan/dfd5362004be37ff5e016b6a42be5083
package d3d11_triangle
import "core:strings"
import "core:runtime"
import "core:fmt"
import "core:sys/windows"
import d3d11 "vendor:directx/d3d11"
import dxgi "vendor:directx/dxgi"
import d3dc "vendor:directx/d3d_compiler"
@DaseinPhaos
DaseinPhaos / clink_prompt.lua
Created May 26, 2021 06:37 — forked from mickaelandrieu/clink_prompt.lua
My config for cmder prompt