Skip to content

Instantly share code, notes, and snippets.

@apilatosba
apilatosba / DearImgui.cs
Created October 19, 2025 18:45
custom dearimgui backend. vulkan + glfw + c#
using Apila;
using glfw;
using static glfw.Native;
// using ImGuiNET;
using Hexa.NET.ImGui;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
@apilatosba
apilatosba / BiDictionary.cs
Last active September 28, 2025 20:47
a bidictionary data structure for c#
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Apila {
// Maps T1 <-> T2 one-to-one (bijective)
public class BiDictionary<T1, T2> : IEnumerable<KeyValuePair<T1, T2>> {
readonly Dictionary<T1, T2> forward;
readonly Dictionary<T2, T1> backward;
readonly ReadOnlyDictionary<T1, T2> roForward;
@apilatosba
apilatosba / ImGuiController.cs
Last active June 30, 2024 15:04
imgui custom backend. for my own use. to use it initialize a new instance and set the callbacks and at the start of every frame call Update() and at the end of every frame call Render(). mostly yoinked from imgui backends example and imguinet opentk sample
using DotGLFW;
using ImGuiNET;
using System;
using System.Diagnostics;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static DotGL.GL;
using static lidl.GLExtensions;