Skip to content

Instantly share code, notes, and snippets.

@ocornut
ocornut / (Archived) imgui_memory_editor.h
Last active August 28, 2024 05:01
Mini memory editor for dear imgui (to embed in your game/tools)
// Mini memory editor for Dear ImGui (to embed in your game/tools)
// Animated GIF: https://twitter.com/ocornut/status/894242704317530112
// THE MEMORY EDITOR CODE HAS MOVED TO GIT:
// https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor
// Click "Revisions" on the Gist to see old version.
@flibitijibibo
flibitijibibo / flibitPackaging.md
Created June 17, 2016 16:00
Hope you like reading ldd output!

A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.

This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:

http://www.flibitijibibo.com/magfest2016/

https://www.youtube.com/watch?v=B83CWUh0Log

I would recommend looking at that first! After that, read on...

@baines
baines / freetype-atlas.c
Created July 15, 2016 13:32
minimal freetype texture atlas example
#include <stdio.h>
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#define NUM_GLYPHS 128
struct glyph_info {
int x0, y0, x1, y1; // coords of glyph in the texture atlas
@nlguillemot
nlguillemot / main.cpp
Created April 28, 2017 03:03
stable opengl timestamps with D3D12
#ifdef _WIN32
#include <d3d12.h>
#include <dxgi1_5.h>
#pragma comment(lib, "d3d12.lib")
#pragma comment(lib, "dxgi.lib")
#endif
#ifdef _WIN32
void SetStablePowerState()
@HiImJulien
HiImJulien / Swift Meets CCxx.md
Last active September 16, 2024 16:12
This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.

Swift Meets C/C++

This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.


In this example we're going to invoke a function called say_hello, which, as the name already suggests, prints "Hello, World!" to the terminal.

@McMartin
McMartin / read-dls.py
Last active July 10, 2024 00:36
Read DLS file using Python
import struct
import sys
from chunk import Chunk
FOURCC_DLS = b'DLS '
FOURCC_DLID = b'dlid'
FOURCC_COLH = b'colh'
FOURCC_WVPL = b'wvpl'
@floooh
floooh / imgui_buffer_update.md
Last active February 9, 2022 12:26
How I update vertex/index buffers for Dear Imgui

My Dear Imgui render loop looks a bit unusual because I want to reduce calls to WebGL as much as possible, especially buffer update calls.

This means:

  • only one buffer each for all per-frame vertex- and index-data
  • only one update call each per frame for vertex- and index-data (with my own double-buffering, since buffer-orphaning doesn't work on WebGL, and with this I'm also independent from any 'under-the-hood' magic a GL driver might or might not perform)
@bruxisma
bruxisma / README.md
Created April 22, 2019 21:14
Minimal WASM C++ Test

Minimal WASM C++ Test

I spent a lot of hair tearing to figure out the minimal amount of work needed to get some C++ to output to HTML.

Simply clone this gist into a directory and everything should be good to go. You can run the build.sh file after a chmod +x, or just run the command manually. Anything goes, really.

This was written on April 22nd, 2019. Things are apparently changing enough that this might not be valid in the future. A lot of the work is handled by the wasm-ld tool, rather than by clang. It makes me wonder if something like CMake integration is even possible. That said, this code was run and tested on windows, in addition to linux and macOS. I used the 8.0 release of clang.

Links

  • CMakeSL RSS - I'm going to reuse my page feed. I'm not going to post every article at r/cpp or r/cmake, so if you want to be notified about new CMakeSL arts, the RSS is the only reliable way.
  • CMakeSL repo

CMakeSL - abseil-cpp scripts

This article is meant to present what's going on with the CMakeSL project. If you don't know what the CMakeSL is, check out this gist or the readme.

CMakeSL changes

@Reedbeta
Reedbeta / interesting-libs.txt
Last active July 4, 2023 02:38
Interesting libraries I might like to use in a project
Interesting libraries I might like to use in a project...
Asset loading:
assetsys.h - virtual filesystem with ZIP backing, overlaying, etc https://github.com/mattiasgustavsson/libs/blob/master/docs/assetsys.md
cute_filewatch.h - file modification watching, for runtime reloading etc https://github.com/RandyGaul/cute_headers/blob/master/cute_filewatch.h
flatbuffers - data serialization, zero-copy deserialization, extensible schemas https://github.com/google/flatbuffers
stb_image - https://github.com/nothings/stb/blob/master/stb_image.h
tinyexr - https://github.com/syoyo/tinyexr
tinygltf - https://github.com/syoyo/tinygltf
tinyobjloader - https://github.com/syoyo/tinyobjloader