Skip to content

Instantly share code, notes, and snippets.


Nicolas Lelong rotoglup

View GitHub Profile
View expr.c
void parse_expr(Value *dest);
Sym *parse_ident(void) {
if (tok != TOK_IDENT) {
error("Expected identifier");
Sym *ident = tok_sym;
return ident;
bkaradzic /
Last active Jun 30, 2021
Why I think Immediate Mode GUI is way to go for GameDev tools

Why I think Immediate Mode GUI is way to go for GameDev tools


Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
View gob.h
// My investigations on the C standard compliance of Gob and related techniques:
#pragma once
#include <stdint.h>
#pragma pack(push, 8)
#if __cplusplus >= 201103L || (__cplusplus && _MSC_VER >= 1900)
View fibers.c
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <string.h>
#define streq(a, b) (!strcmp((a), (b)))
#ifndef __USE_GNU
#define __USE_GNU
pervognsen / mu.cpp
Last active May 30, 2021
Mu as of the second stream
View mu.cpp
#include "mu.h"
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <stdarg.h>
#define NO_STRICT
dwilliamson /
Last active Apr 2, 2021
Minimal Code Generation for STL-like Containers

This is my little Christmas-break experiment trying to (among other things) reduce the amount of generated code for containers.


The C++ STL is still an undesirable library for many reasons I have extolled in the past. But it's also a good library. Demons lie in this here debate and I have no interest in revisiting it right now.

The goals that I have achieved with this approach are:

aras-p / GraphicsCapsGLES.h
Created Apr 26, 2015
Part of runtime flags that kick in different things on our GL implementaton
View GraphicsCapsGLES.h
int maxAASamplesConst; // gles2 img/apple/ext extensions all use different constants (facepalm)
int halfConst; // gles2 and gles3 have different constants for half float type
int texSRGBAConst; // gles2 (without 'internal format' ext) and gles3 have different constants for SRGB RGBA texture type
int texSRGBConst; // gles2 (without 'internal format' ext) and gles3 have different constants for SRGB RGB texture type
int etcFormatConst; // gles2/gles3 have different standard etc formats
bool isPvrGpu;
bool isMaliGpu;
bool isAdrenoGpu;
bool isTegraGpu;
View Tetrahedra-based Volumetric Meshes.txt
Below I collected relevant links and papers more or less pertaining to the subject of tetrahedral meshes.
It's an ever-growing list.
Relevant links:
ocornut / printf_tips.cpp
Last active Feb 7, 2019
C/C++ tips for using printf-style functions
View printf_tips.cpp
// C/C++ tips for using printf-style functions
// Lots of manipulation can be expressed simply and fast with printf-style formatting
// Also helps reducing the number of temporaries, memory allocations or copies
// ( If you are looking for a simple C++ string class that is printf-friendly and not heap-abusive,
// I've been using this one: )
// If you are interested in a FASTER implementation of sprintf functions, see stb_sprintf.h
// How to concatenate non-zero terminated strings