Skip to content

Instantly share code, notes, and snippets.

View Falconerd's full-sized avatar
⚙️
Crankin'

Dylan Falconer Falconerd

⚙️
Crankin'
View GitHub Profile
@Falconerd
Falconerd / README.md
Created October 7, 2025 04:55
Odin + Raylib Hot Reload

Build Instructions

Build Cradle

odin build main.odin -file -out:build/debug.exe -debug

Build Game (This one is the hot reload one)

odin build game.odin -file -build-mode:dll -out:build/game.dll -debug

USize AlignForward(USize p, USize alignment) {
USize mod;
if (0 == p % alignment) {
return p;
}
mod = p & (alignment - 1);
if (mod != 0) {
@Falconerd
Falconerd / sprite_animation_example.odin
Created March 12, 2025 05:05
A simple, yet effective way of handling sprite animations with (immediate) callbacks.
package main
import "core:fmt"
import rl "vendor:raylib"
Vec2 :: [2]f32
Rect :: rl.Rectangle
Sprite_Animation_Frame :: struct {
@Falconerd
Falconerd / arena.c
Last active July 24, 2024 05:39
Some game code stuff
#include "common.h"
uintptr_t align_forward(uintptr_t ptr, size_t alignment) {
uintptr_t p, a, modulo;
if (!is_power_of_two(alignment)) {
return 0;
}
p = ptr;
a = (uintptr_t)alignment;
@Falconerd
Falconerd / isq_ui.h
Created June 30, 2023 07:19
IMGUI with Flexbox layout
// Usage:
// ISQ_UI_RENDER_RECT(buffer, count)
// must be defined by the user.
// buffer: pointer to an array of rects
// count: number of rects in the array
// rect:
// vec4 min, max;
// vec4 color;
@Falconerd
Falconerd / init.lua
Last active March 13, 2025 21:29
Simple nvim setup Odin+C
vim.cmd([[
let mapleader = ' '
]])
require('packer').startup(function(use)
use "BurntSushi/ripgrep"
use "danilamihailov/beacon.nvim"
use "folke/todo-comments.nvim"
use "folke/trouble.nvim"
use "goolord/alpha-nvim"
@Falconerd
Falconerd / machine.js
Created April 28, 2021 04:53
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'Dog API',
initial: 'idle',
context: {
dog: null
},
states: {
idle: {
on: {
FETCH: 'loading'
/* dict.h */
#pragma once
#include <stdlib.h>
struct dict {
int *hashed_keys;
void *values;
int count;

Lost Knowledge - Programming mastery will save lives

Introduction

As the layers of abstraction get piled onto our software solutions, we have lost

<sentence> ::= <subj> <obj> <verb> <part>
<sub> ::= <noun>
<noun> ::= dog | cat | man | woman | robot | pen
<obj> ::= <noun>
<verb> ::= kick | whack | dance | own
<part> ::= now | earlier | later
<subj> <obj> <verb> <part>
man pen own now == "A man owns a pen"
dog cat dance earlier == "A dog was dacing with a cat"