Skip to content

Instantly share code, notes, and snippets.

View rotoglup's full-sized avatar

Nicolas Lelong rotoglup

View GitHub Profile
import { FileLoader } from './FileLoader';
import { DataTexture } from '../textures/DataTexture';
import { DefaultLoadingManager } from './LoadingManager';
import { _Math } from '../math/Math';
function IESLoader(manager) {
this.manager = (manager !== undefined) ? manager : DefaultLoadingManager;
pervognsen / expr.c
Last active February 5, 2023 17:27
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 June 28, 2024 19:11
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
attilaz / gist:d75fc7d4ab75388a42720f97a7075c81
Created November 26, 2016 18:45
metal transient object lifetime
From metal documentation:
"Command buffer and command encoder objects are transient and designed for a single use.
They are very inexpensive to allocate and deallocate, so their creation methods return autoreleased objects."
Autorelease example:
NSAutoreleasePool* autoreleasePool = [[NSAutoreleasePool alloc] init];
//c is an autoreleased object
pervognsen / gob.h
Last active March 31, 2024 22:42
// 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)
#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 December 15, 2023 14:43
Mu as of the second stream
#include "mu.h"
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <stdarg.h>
#define NO_STRICT
dwilliamson /
Last active April 23, 2023 14:17
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 April 26, 2015 07:56
Part of runtime flags that kick in different things on our GL implementaton
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;