Skip to content

Instantly share code, notes, and snippets.

View sokol_test.c
#define SOKOL_D3D11
#define SOKOL_IMPL
#include "sokol_app.h"
#include "sokol_gfx.h"
#include "sokol_time.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4201) /* warning C4201: nonstandard extension used : nameless struct/union */
@incrediblejr
incrediblejr / optional_instance.h
Created Aug 15, 2019
optional instance created by placement-new with stack-memory
View optional_instance.h
/*
* optional instance created by placement-new with stack-memory
*
* ex.
* struct ThreadContextScope {
* ThreadContextScope() { // setup thread-context }
* ~ThreadContextScope() { // teardown thread-context }
* };
*
* void some_function(void) {
View ijss.h
/* clang-format off */
/*
ijss : IncredibleJunior SparseSet
sparse set [1] for bookkeeping of dense<->sparse index mapping or
a building block for a simple LIFO index/handle allocator
[1] https://research.swtch.com/sparse
*/
@incrediblejr
incrediblejr / ijsl.h
Created Apr 11, 2018
quick and dirty printf-logging with (compile time) 'multiple outputs'
View ijsl.h
/* clang-format off */
/*
ijsl : IncredibleJunior Simple Log
quick and dirty printf-logging with (compile time) 'multiple outputs' implemented
as a stb-style header-file library[1] which means that in *ONE* source file declare
the implementation (see example) and the other source files should just include
this file.
example setup for Windows (declare OutputDebugStringA ourselves to avoid including windows.h)
@incrediblejr
incrediblejr / ijlat.h
Created May 25, 2016
(Simple) Lua Allocation Tracker
View ijlat.h
/* ijlat.h - v0.1a - (Simple) Lua Allocation Tracker -- public domain -- @incrediblejr, May 2016
ABOUT
A simple Lua allocation tracker.
USAGE
The memory tracker is implemented as a [stb-style header-file library][1] which means that
in *ONE* source file, put: