3D game framework in C, with Luajit bindings now.
-
C++. C. -
Fast. Naive. -
Modern. Simple. -
Full featured. Small. -
Rich build system. Single file. -
Royaltie fee. Free and unlicensed.
- Pipeline: configurable and integrated asset pipeline.
- Embedded: single-file, all dependencies included.
- Compiler: MSVC, MINGW64, TCC, GCC and clang.
- Platform: Windows, Linux and OSX.
- DS: hash, sort, array/vector, map, set.
- Math: rand, noise, ease, vec2/3/4, mat33/34/44, quat.
- Geometry: ray, line, plane, aabb, sphere, capsule, triangle, poly and frustum.
- Window: windowed, soft/hard fullscreen, msaa, icon, cursor handling.
- Input: keyboard, mouse and gamepads.
- Script: Lua scripting, Luajit bindings.
- Network: downloads (HTTPS) and sockets (TCP/UDP).
- UI: color3/4, button, list, slider, toggle, checkbox, editbox, dialog, image, menus.
- Font: TTF and TTC. Basic syntax highlighter. Unicode ranges, atlasing, I18N.
- Image: JPG, PNG, TGA, BMP, PSD, PIC, PNM, ICO.
- Texture: KTX/2, PVR, DDS, ASTC, BASIS, HDR.
- Texel: Depth, R, RG, RGB, RGBA, BC1/2/3/4/5/6/7, PVRI/II, ETC1/2, ASTC.
- Audio: WAV/FLAC, OGG/MP1/MP3, MOD/XM/S3M/IT, SFXR and MID.
- Video: MP4, MPG, OGV, MKV, WMV and AVI.
- Model: IQM/E, GLTF/2, GLB, FBX, OBJ, DAE, BLEND, MD3/5, MS3D, SMD, X, 3DS, BVH, DXF, LWO.
- Render: 2D Sprites, spritesheets and batching.
- Render: 3D Anims, skeletal anims and hardware skinning.
- Render: 3D Debugdraw, batching and vectorial font.
- Render: Cubemaps, panoramas and spherical harmonics. Rayleigh/Mie scattering.
- Render: Post-effects (SSAO,FXAA1/3,CRT,Contrast,Grain,Outline,Vignette...).
- Compression: DEFLATE, LZMA, LZ4, ULZ, BALZ, BCM, CRUSH, LZW3, LZSS and PPP.
- Virtual filesystem: ZIP, PAK, TAR and DIR.
- Level data: JSON, JSON5, SJSON, XML.
- Disk cache.
- Scene handling.
- Profiler, stats and leaks finder.
- Documentation (wip).
- Network: NAT traversal. Socketless API, message API and pub/sub wrappers (enet/websocket).
- Render: Materials (colors✱, textures✱, matcaps✱, videos✱, shadertoys✱). Shadertoys as post-fx✱.
- Render: Hard/soft shadow mapping and baked lightmaps.
- Scene: toggles on/off (billboards✱, materials, un/lit, cast shadows, wireframe, skybox/mie, collide, physics).
- Scene: node singleton display, node console, node labels, node outlines.
- Math: quat2, bezier, catmull.
- Editor: gizmos✱, scene tree, property editor, load/save, undo/redo, copy/paste.
- Level objects: volumes✱, triggers, platforms, streaming.
- Script: DLL✱ (module->plugin/sys), Lua✱, Luajit✱, Teal✱ and TypeScript.
- Script: Refl/meta binding tool (during cook stage).
- Pipeline: Extend: shaders, bindings. Per-platform✱, per-type✱, per-asset options. GIF, PKM.
- Pipeline: Extend atlas (sprite/lightmaps). Fit packing (sprites).
- Font: text layout and shaping, underlining, soft/hard shadows, outlines.
- Maybe: Tiled maps and 2D spines.
- Maybe: Animation pass.
- Maybe: AI/Logic pass.
- Maybe: Lighting/PBR pass.
- Maybe: VM/ECS/Replication pass.
- API: More examples. Also, less examples.
- API: Discuss API and freeze it.
- API: Document everything.
Type MAKE.bat
(Win) or sh MAKE.bat
(Linux/OSX) to build everything. Alternatively,
echo Windows (vc+tcc) && cl demo.c fwk.c
echo Windows (mingw64) && gcc demo.c fwk.c -o demo -w -lws2_32 -lgdi32 -lwinmm -ldbghelp -std=c99
echo Linux (gcc+clang+tcc) && cc demo.c fwk.c -o demo -w -lm -ldl -lpthread
echo OSX (gcc+clang) && cc demo.c -ObjC fwk.c -o demo -w -framework cocoa -framework iokit
- Note: TCC is partially supported on Windows+Linux. Beware, no threading.
- Note: FWK as DLL:
cl fwk.c /LD /DAPI=EXPORT && cl demo.c fwk.lib /DAPI=IMPORT
.
- Split FWK into separate files by running
art/tools/split.bat
(orsh art/tools/split.bat
in Linux/OSX). - Merge those files back into FWK by running
art/tools/join.bat
(orsh art/tools/join.bat
in Linux/OSX). - Optionally, generate a single-header distribution by executing following script:
echo // This C file is a header that you can #include. Do #define FWK_C > fwk-single-header.c
echo // early in **one** compilation unit to unroll the implementation. >> fwk-single-header.c
type fwk.h >> fwk-single-header.c
echo #ifdef FWK_C >> fwk-single-header.c
echo #pragma once >> fwk-single-header.c
type fwk.c >> fwk-single-header.c
echo #endif // FWK_C >> fwk-single-header.c
- Dropped files into game window will be imported & saved into
art/import
folder. - Linux/OSX users can optionally install wine to use the Windows pipeline as an alternate asset pipeline (use
--with-wine
flag). - Depending on your IDE, you might need to split all amalgamated files when debugging FWK.
- Luajit: Luajit bindings are provided in the fwk.lua auto-generated file.
- Luajit: You can test it by typing
cl fwk.c /LD /DAPI=EXPORT && art\tools\luajit art\demos\demo_luajit.lua
- Nelua: Nelua bindings provided by Rabia Alhaffar.
This software is released into the public domain.
Also dual-licensed as 0-BSD or MIT (No Attribution) for those countries where public domain is a concern (sigh).
Any contribution to this repository is implicitly subjected to the same release conditions aforementioned.
- FMS_Cat, for nicest VHS/VCR shader around (MIT).
- Goblin165cm, for witch 3D model (CC BY 4.0).
- Nanofactory, for kgirls01 3D model (CC BY-NC-ND 4.0).
- Quaternius, for the lovely 3D robots (CC0).
- Rxi, for lovely sprites & cats demo (MIT).
- wwwtyro, for nicest rayleigh/mie scattering shader around (CC0).
- Aaron Barany, for cuttlefish (APACHE2).
- Assimp authors, for assimp (BSD3).
- Bernhard Schelling, for tml.h (Zlib) and tsf.h (MIT).
- ffmpeg authors, for ffmpeg (LGPL21).
- Imagination, for pvrtextoolcli (ITL).
- Krzysztof Gabis, for split.py/join.py (MIT).
- Lee Salzman, for iqm.cpp (PD).
- Mattias Gustavsson, for mid.h (PD).
- Michael Schmoock, for lcpp (MIT).
- Morgan McGuire, for markdeep (BSD2).
- Tomas Pettersson, for sfxr (PD).
- Tor Andersson, for assiqe.c (BSD).
- Barerose, for swrap (CC0).
- Camilla Löwy, for glfw3 (Zlib).
- Dave Rand for ppp (PD).
- David Herberth, for glad generated code (PD).
- David Reid, for miniaudio (PD).
- Dominic Szablewski, for pl_mpeg (MIT).
- Dominik Madarász, for json5 parser (PD).
- Eduard Suica, for tlse (PD).
- Haruhiko Okumura for lzss (PD).
- Igor Pavlov for LZMA (PD).
- Ilya Muravyov for bcm, balz, crush, ulz, lz4x (PD).
- Jon Olick, for jo_mp1 and jo_mpeg (PD).
- Joonas Pihlajamaa, for JUnzip library (PD).
- Lee Salzman, for IQM spec & player (PD).
- Lee Salzman, V.Hrytsenko and D.Madarász, for enet (MIT).
- Libtomcrypt, for libtomcrypt (Unlicense).
- Lua authors, for Lua language (MIT).
- Mattias Gustavsson, for thread.h and https.h (PD).
- Micha Mettke, for nuklear (PD).
- Omar Cornut, vaiorabbit, for tables of unicode ranges (MIT-0).
- Rich Geldreich, for miniz (PD).
- Ross Williams for lzrw3a (PD).
- Samuli Raivio, for bq_websocket (PD).
- Sean Barrett, for stb_image, stb_image_write and stb_vorbis (PD).
- Sebastian Steinhauer, for sts_mixer (PD).
- Stefan Gustavson, for simplex noise (PD).
- Vassvik, for mv_easy_font (Unlicense).
- Special thanks to @ands (PD), @barerose (CC0), @datenwolf (WTFPL2), @evanw (CC0), @glampert (PD), @krig (CC0), @sgorsten (Unlicense) and @vurtun (PD) for their math libraries.
Still looking for alternatives? amulet, aroma, astera, blendelf, bullordengine, candle, cave, chickpea, corange, cute, dos-like, ejoy2d, exengine, gunslinger, hate, island, juno, l, lgf, limbus, love, lovr, mini3d, mintaro, mio, opensource, pez, pixie, punity, ricotech, rizz, tigr,