This is the resource repositry for my memory managment lecture / workshop series at Breda University of applied sciences - Games. It is mainly targeted for game developers
import sys | |
import argparse | |
def bytesToCHeader(fileBytes: bytes, inputFileName: str, variableName: str) -> str: | |
fileText = "#pragma once\n"; | |
fileText += "\n"; | |
fileText += "//----------------------------------------------\n"; | |
fileText += "// This is an auto-generated file.\n"; | |
fileText += "// It contains the binary representation of " + inputFileName + " as a C-Array.\n"; | |
fileText += "//----------------------------------------------\n"; |
--[[ | |
The idea of this tweetcart was to get the "water ripple" effect with a grid of points. | |
Each point is applied a sinusoidal effect, | |
depending on its distance from the center, and the elapsed time. | |
The points go up then down following that sinusoidal, | |
and a color gradient is applied to get a nice pseudo-3d effect. | |
You can copy-paste this whole code inside PICO-8 and just run it. |
/* | |
This is a very simple and not very robust parser for nested lists. | |
It doesn't copy the source input, but builds a structured representation of the | |
input with pointers to values. This could be useful in memory-constrained environments. | |
The syntax is: | |
(value1 (value2 value3) value4) |
This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.
It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.
To see it in action, go to craigmod.com and press CMD-/
and start typing.
/* EDIT: | |
* For future reference, this code doesn't work right so don't use it. | |
* (but probably could be fixed with some care and attention) | |
*/ | |
// Tiny std::function workalike, to allow storing lambdas with captures. (public domain) | |
template <typename> struct fnptr; | |
template <typename Ret, typename... Args> struct fnptr<Ret(Args...)> { | |
void *obj = nullptr; | |
Ret (*wrap)(void*, Args...) = nullptr; |
The below is a breakdown / bird's eye view of how a sparse-array backed ECS like EnTT or Shipyard works.
Please see the thanks and references at the bottom - without their help I would not have been able to share this breakdown with you... everything here is really just notes and rephrasing of what they've written already :)
Also, these notes do not cover archetype systems (like unity) nor adaptations of archetypes (like in Flecs). Though there's a couple comparative footnotes at the end.
Here we go!
#! /usr/bin/env bash | |
# DISCLAIMER: | |
# This code IS WITHOUT ANY WARRANTY! | |
# Use at own risk | |
FOLDER='.vscode' | |
LAUNCH_FILE='launch.json' | |
MAGIC_FILE='vscode_script' |
package haxegon; | |
import lime.ui.GamepadButton; | |
import starling.events.*; | |
import openfl.ui.Keyboard; | |
import openfl.events.FocusEvent; | |
import lime.ui.Gamepad; | |
import lime.ui.GamepadButton; |
/* 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 | |
*/ |