Skip to content

Instantly share code, notes, and snippets.

View NocturnDragon's full-sized avatar

X NocturnDragon

View GitHub Profile
@paniq
paniq / perfect_spatial_hashing.txt
Last active June 21, 2024 14:56
Perfect Spatial Hashing
# forays into
Perfect Spatial Hashing (Lefebvre & Hoppe)
http://hhoppe.com/perfecthash.pdf
how it works:
There are two parts: a slow encoding step, and a fast decoding step.
Encoding
//
// TinyCRT, revamp and TinyWin support by Don Williamson, 2011
// Based on http://www.codeproject.com/KB/library/tlibc.aspx and LIBCTINY by Matt Pietrek
//
#pragma once
#ifdef USE_DEFAULT_CRT
@vurtun
vurtun / cont.c
Last active December 21, 2019 17:06
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <ctype.h>
/* ---------------------------------------------------------------------------
@vurtun
vurtun / _readme_quarks.md
Last active June 26, 2025 00:06
Quarks: Graphical user interface

gui

@Celtoys
Celtoys / tinywin.h
Created December 15, 2017 21:33
Windows Basics
#pragma once
// This allows windows.h to be included first, overriding this header file, but be careful
// not to do this everywhere as compile-times suffer.
#ifndef _WINDOWS_
#include <basetsd.h>

Graphical User Interfaces

Last time I wrote a little bit about my current GUI research progress. There are some things that were misunderstood so I want to clarify some fundamental design decisions and finally write up some current problems and their solutions.

First up I want to clarify a component is not another term for what is usually refered to as widget. Instead wigets in this implementation are made out of n >= 1 components. Components themself are just rectangles with attributes left, right, top, bottom, center_x, center_y, width and height some behavior flags and an optional surface to draw into. For example a scroll regions is made up out of at least three

@vurtun
vurtun / gui.md
Last active October 4, 2023 15:44

Graphical User Interfaces

For the last few weeks I spend some time coding, writing and cleaning up my notes from almost a year since I published nuklear.

Basically this is a possible implementation for a graphical user interface builder backend with support for an immediate mode style API. So it provides a way to define non-mutating UI state, an immediate mode style API for dynamic UI components (lists,trees,...) and a combination of both.

The core implementation is ~800 LOC without any kind of default widgets or extensions. At first this seems quite counter intuitive. However since the inherent design allows for lots of different ways to define any widget like buttons it does not make sense to provide a specific default implementation. The way this code was architectured furthermore removes the need for style/skinning configurations used in Nuklear since widget painting is just calling a small

@dwilliamson
dwilliamson / Pimpl.cpp
Last active May 12, 2017 16:10
How I Pimpl
struct Data
{
Data()
{
}
~Data()
{
}
@Reedbeta
Reedbeta / cool-game-programming-blogs.opml
Last active December 4, 2025 22:28
List of cool blogs on game programming, graphics, theoretical physics, and other random stuff
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Graphics, Games, Programming, and Physics Blogs</title>
</head>
<body>
<outline text="Tech News" title="Tech News">
<outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/>
<outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/>
<outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/>
@dwilliamson
dwilliamson / LengthPyCGen.h
Last active June 15, 2018 20:24
SFINAE vs. PyCGen - which one would you rather lookup in a header file?
/*$pycgen
code = """
T length(const T2& v);
T length(const T3& v);
T length(const T4& v);
"""
EmitRepl(code, "T:" + vector_types)
*/
//$pycgen-begin
float length(const float2& v);