Skip to content

Instantly share code, notes, and snippets.

View API

API Design: Builder APIs (October-2020)

Some time has past (three years!) since I last wrote about API specifically about coroutines style APIs so I thought why not write another one about a different API type I encounter relatively often. The builder API.

Now first let me take a step back and put this into 20,000 feet view on where builder APIs are located in the grant scheme. In general everything in computing is separated into input, processing and finally output. In its most basic form I am currently typing on my keyboard. All pressed keys are processed from the OS up to the browser I am writing this in and finally rendered and displayed on the screen as output. Of course this example is very user centric

roxlu /
Created Oct 6, 2016
Script to focus application (Windows 10 shows taskbar when application starts) (source:
call :focus "Title of Window"
timeout /t 10 /nobreak > NUL
goto start
::exit /b
setlocal EnableDelayedExpansion
if ["%~1"] equ [""] (
roxlu / TestFboChangeBuffer.cpp
Last active Sep 11, 2020
Comparing the performance of different ping/pong techniques when using FBOs. One version uses two fbos and swaps between these, the other switches the draw and read buffer. See these results for a comparison. It seems that switching read / draw b…
View TestFboChangeBuffer.cpp
#include <poly/Log.h>
#include <TestFboChangeBuffer.h>
using namespace poly;
tex[0] = 0;
roxlu / fun.cpp
Last active Aug 29, 2015 — forked from kizzx2/fun.cpp
View fun.cpp
// fun.cpp
extern "C"
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include <iostream>
roxlu /
Created Dec 28, 2014
Apache, PHP and MySQL build script for Mac 10.10
roxlu / CMakeLists.txt
Created Sep 26, 2014
Work in progress, simple cross platform mutex and threading code
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8.11)
set(id ${bd})
add_executable(test_thread test_thread.cpp)
if (WIN32)
roxlu / opengl_wrappers.c
Last active Mar 18, 2018
A couple of wrappers for opengl which are handy when you want to provide some openGL features in your library. Simply embed these into your cpp file. (Note that your executable will become slightly bigger because of this.)
View opengl_wrappers.c
See for the latest version.
Author: roxlu
/* ------------------------------------------------------------------------*/
roxlu / AsyncUpload.cpp
Last active Apr 26, 2019
Experimental code to test fast pixel transfers using PBOs.
View AsyncUpload.cpp
#include <gfx/AsyncUpload.h>
namespace gfx {
roxlu / test_fex_load_image.cpp
Created Aug 22, 2014
Examples on how to load + reuse memory using rx_load_png and rx_load_jpg
View test_fex_load_image.cpp
Plain test which loads + reloads a couple of images and reallocating the
previously allocated buffer when needed. Just a tiny test to speed up
the image loading process.
roxlu / test_vorbis.c
Last active Aug 29, 2015
Decoding vorbis flow (w/o cleanup yet).
View test_vorbis.c
See online version:
Example code which decodes a .ogg file that contains vorbis and/or
some other stream, e.g. theora. We ignore all non-vorbis streams and
simply flush the packets.