All Projects → RandyGaul → Cute_headers

RandyGaul / Cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games

Programming Languages

c
50402 projects - #5 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Cute headers

Exengine
A C99 3D game engine
Stars: ✭ 391 (-88.06%)
Mutual labels:  game, collision-detection, collision, opengl
Bounce
Bounce is a 3D physics engine for games.
Stars: ✭ 300 (-90.84%)
Mutual labels:  game, collision-detection, library, math
Raz
Modern & multiplatform game engine in C++17
Stars: ✭ 161 (-95.08%)
Mutual labels:  opengl, library, cross-platform
Tprpix
a Cross-Platform, 2D Survival Sandbox Game Project. Based on C++17/cmake/OpenGL/SQLite3.
Stars: ✭ 448 (-86.32%)
Mutual labels:  game, opengl, cross-platform
Lasercrabs
Launch your LASERCRAB at walls, ceilings, and enemy heads in this indie multiplayer shooter where "move" and "attack" are synonymous.
Stars: ✭ 465 (-85.8%)
Mutual labels:  game, opengl, cross-platform
Sfml
Simple and Fast Multimedia Library
Stars: ✭ 7,316 (+123.46%)
Mutual labels:  opengl, audio, cross-platform
Borealis
Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx).
Stars: ✭ 135 (-95.88%)
Mutual labels:  opengl, library, cross-platform
Rigelengine
A modern re-implementation of the classic DOS game Duke Nukem II
Stars: ✭ 393 (-88%)
Mutual labels:  game, opengl, cross-platform
Arxlibertatis
Cross-platform port of Arx Fatalis, a first-person role-playing game
Stars: ✭ 602 (-81.61%)
Mutual labels:  game, opengl, cross-platform
Expo Crossy Road
🐥🚙 Crossy Road game clone made in Expo (iOS, Android, web), THREE.js, Tween, React Native. 🐔
Stars: ✭ 701 (-78.59%)
Mutual labels:  game, opengl, cross-platform
Librg
🚀 Making multi-player gamedev simpler since 2017
Stars: ✭ 813 (-75.17%)
Mutual labels:  game, library, networking
Mango
mango fun framework
Stars: ✭ 343 (-89.52%)
Mutual labels:  opengl, math, compression
Midir
Cross-platform realtime MIDI processing in Rust.
Stars: ✭ 221 (-93.25%)
Mutual labels:  library, audio, cross-platform
Redoflacs
Parallel BASH commandline FLAC compressor, verifier, organizer, analyzer, and retagger
Stars: ✭ 71 (-97.83%)
Mutual labels:  library, audio, compression
Rubeus
A cross platform 2D game engine written in C++ for beginners
Stars: ✭ 159 (-95.14%)
Mutual labels:  game, opengl, cross-platform
Open Builder
Open "Minecraft-like" game with multiplayer support and Lua scripting support for the both client and server
Stars: ✭ 569 (-82.62%)
Mutual labels:  game, opengl, networking
Minijvm
Develop iOS Android app in java, Cross platform java virtual machine , the minimal jvm .
Stars: ✭ 127 (-96.12%)
Mutual labels:  game, opengl, cross-platform
Engine
A basic cross-platform 3D game engine
Stars: ✭ 208 (-93.65%)
Mutual labels:  game, opengl, cross-platform
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-Möller
Stars: ✭ 17 (-99.48%)
Mutual labels:  collision, collision-detection
exengine
A C99 3D game engine
Stars: ✭ 487 (-85.13%)
Mutual labels:  collision, collision-detection

cute_headers

Various single-file cross-platform C/C++ headers implementing self-contained libraries.

library description latest version language(s)
cute_c2 2D collision detection routines on primitives, boolean results and/or manifold generation, shape cast/sweep test, raycasts 1.09 C/C++
cute_tiled Very efficient loader for Tiled maps exported to JSON format 1.06 C/C++
cute_aseprite Parses .ase/.aseprite files into a compact and convenient struct collection 1.01 C/C++
cute_sound Load/play/loop/pitch (with plugin)/pan WAV + OGG (stb_vorbis wrapper for OGG) in mono/stereo, high performance custom mixer, decent performance custom pitch shifter (does not stretch time, done via plugin, see cute_sound_pitch_plugin) 1.12 C/C++
cute_time Quick and dirty "main loop" timer function, along with utilities for integer-based high resolution timing 1.0 C/C++
cute_memfile Utility for calling fscanf-alike functions on files embedded in memory 1.0 C++
cute_files Directory traversal, both recursive and manual 1.0 C/C++
cute_math Professional level 3D vector math via SSE intrinsics 1.02 C++
cute_png load/save PNG, texture atlas compiler, DEFLATE compliant decompressor 1.04 C/C++
cute_utf utf-8 and utf-16 encoder/decoder 1.0 C/C++
cute_huff minimal static huffman encoder/decoder (compression) 1.0 C/C++
cute_path c-string utility functions for Shlwapi.h style path manipulation 1.01 C/C++
cute_alloc straight-forward but useful allocator collection 1.01 C/C++
cute_math2d 2d vector math and shape routines 1.0 C++
cute_spritebatch Run-time 2d sprite batcher. Builds atlases on-the-fly in-memory. Useful to implement a sprite batcher for any purpose (like 2D games) for high-performance rendering, without the need to precompile texture atlases on-disk. 1.04 C/C++
cute_filewatch Directory watcher wrapping assetsys.h, for virtual file paths and zip mounting 1.01 C/C++
cute_font Load font atlases, and fill vertex buffers for rasterized fonts, word wrapping, CPU-side clipping, kerning 1.01 C/C++
cute_sync Collection of practical synchronization primitives, including read/write lock and threadpool/task system 1.01 C/C++

How to Use

Generally these headers do not have dependencies and are intended to be included directly into your source (check each header for specific documentation at the top of the file). Each header has a LIBNAME_IMPLEMENTATION symbol; add this to a single translation unit in your code and include the header right after in order to define library symbols. Just include the header as normal otherwise.

Examples and Tests

Some headers also have example code or demos. In this repo just look for the corresponding examples or tests folders. The example folders are particularly useful for figuring out how to use a particular header.

Contact

Here's a link to the discord chat for cute_headers. Feel free to pop in and ask questions, make suggestions, or have a discussion. If anyone has used cute_headers it would be great to hear your experience! https://discord.gg/2DFHRmX

Another easy way to get a hold of me is on twitter @randypgaul.

FAQ

  • What's the point of making a single file? Why is there implementation and static functions in the headers?

Including these headers is like including a normal header. However, to define the implementation each header looks something like this:

// Do this ONCE in a .c/.cpp file
#define LIBNAME_IMPLEMENTATION
#include "libname.h"

// Everywhere else, just include like a typical header
#include "libname.h"

This will turn the file into a header + c file combo, one time. The point of this is: A) handling the header or sending it to people is easy, no zip files or anything just copy and paste a single file; B) build scripts are a pain in the ass, and these single-file libs can be integrated into any project without modifying a single build script.

  • Doesn't writing all the code in a header ruin compile times?

The stigma that header implementations slow compile time come from inline'd code and template spam. In either case every single translation unit must churn through the header and place inline versions of functions, or for templates generate various type-specific functions. It gets worse once the linker kicks in and needs to coalesce translation units together, deleting duplicated symbols. Often linkers are single-threaded tasks and can really bottleneck build times.

A well constructed single-file header will not use any templates and make use of inline sparingly. Additionally well constructed single-file headers use a #define to place implementation (the function definitions and symbols) into a single translation unit. In this way a well crafted single-file header is pretty much the best thing a C compiler can come across, as far as build times go. Especially when the header can optionally #define out unneeded features.

  • Aren't these header only libraries just a new fad?

I personally don't really know if it's a fad or not, but these files aren't really just headers. They are headers with the .C file part (the implementation) attached to the end. It's two different files stuck together with the C preprocessor, but the implementation part never shows up unless the user does #define LIB_IMPLEMENTATION. This define step is the only integration step required to use these headers.

Unfortunately writing a good header library is pretty hard, so just any random header lib out there in the wild is probably not a good one. The STB and RJM are pretty good header libs, and are a good reference to get an idea at what a good header lib looks like. Mattias Gustavsson has my favorite collection of headers.

  • What is the license?

Each lib contains license info at the end of the file. There is a choice between public domain, and zlib.

  • I was looking for a header I've seen before, but it's missing. Where did it go?

Some of the unpopular or not so useful headers became deprecated, and live here now.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].