Skip to content

Instantly share code, notes, and snippets.

@mmozeiko
mmozeiko / win32_webgpu.c
Last active April 6, 2026 14:29
setting up and using WebGPU in C using Dawn
// example how to set up WebGPU rendering on Windows in C
// uses Dawn implementation of WebGPU: https://dawn.googlesource.com/dawn/
// download pre-built Dawn webgpu.h/dll/lib files from https://github.com/mmozeiko/build-dawn/releases/latest
#include "webgpu.h"
#define _CRT_SECURE_NO_DEPRECATE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@tp
tp / line-segment-intersection.ts
Last active April 18, 2024 04:04
Line Segment Intersection
// based on: https://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect
import test from 'ava';
export interface Point2D {
readonly x: number;
readonly y: number;
}
export class LineSegment {