Skip to content

Instantly share code, notes, and snippets.

View TheSandvichMaker's full-sized avatar

Daniël Cornelisse TheSandvichMaker

View GitHub Profile
@TheSandvichMaker
TheSandvichMaker / minimal-imgui-sortable-hit-testing.md
Last active June 23, 2025 21:00
A minimal solution for hit testing sortable UI widgets in an immediate mode API.

If you've ever watched Casey Muratori's original ImGui video you may be familiar with this approach to hit testing in an immediate mode UI:

void ui_set_next_hot(UI_ID id)
{
    ui->next_hot = id;
}

void ui_end_frame()
{
@TheSandvichMaker
TheSandvichMaker / .readme.md
Last active December 28, 2024 22:28
Implementation of David Eberly's mesh clipping algorithm
@TheSandvichMaker
TheSandvichMaker / codepage_437_as_unicode.c
Created July 8, 2021 23:34
codepage 437, represented as unicode in utf8 and utf16
static uint8_t codepage_437_utf8[] =
{
0x0, 0xE2, 0x98, 0xBA, 0xE2, 0x98, 0xBB, 0xE2, 0x99, 0xA5, 0xE2, 0x99, 0xA6, 0xE2, 0x99, 0xA3,
0xE2, 0x99, 0xA0, 0xE2, 0x80, 0xA2, 0xE2, 0x97, 0x98, 0x9, 0xA, 0xE2, 0x99, 0x82, 0xE2, 0x99,
0x80, 0xA, 0xE2, 0x99, 0xAB, 0xE2, 0x98, 0xBC, 0xE2, 0x96, 0xBA, 0xE2, 0x97, 0x84, 0xE2, 0x86,
0x95, 0xE2, 0x80, 0xBC, 0xC2, 0xB6, 0xC2, 0xA7, 0xE2, 0x96, 0xAC, 0xE2, 0x86, 0xA8, 0xE2, 0x86,
0x91, 0xE2, 0x86, 0x93, 0xE2, 0x86, 0x92, 0xE2, 0x86, 0x90, 0xE2, 0x88, 0x9F, 0xE2, 0x86, 0x94,
0xE2, 0x96, 0xB2, 0xE2, 0x96, 0xBC, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,