builds

Archived releases of FWK game engine.

495
30
C

F·W·K

3D game framework in C, with Luajit and Python bindings now.
Archived repo. Development moved to https://github.com/r-lyeh/FWK


Goals

  • [x] C++. C.
  • [x] Fast. Naive.
  • [x] Modern. Simple.
  • [x] Full featured. Small.
  • [x] Rich build system. Single file.
  • [x] Royaltie fee. Free and unlicensed.

Features ᕦ(ᐛ)ᕤ

  • [x] Pipeline: configurable and integrated asset pipeline.
  • [x] Embedded: single-file header, all dependencies included.
  • [x] Projects: Visual Studio, XCode, Ninja, gmake.
  • [x] Compiler: MSVC, MINGW64, TCC, GCC, clang, clang-cl and emscripten.
  • [x] Linkage: Both static linkage and dynamic .dll/.so/.dylib support.
  • [x] Platform: Windows, Linux and OSX. Partial HTML5/Web support.
  • [x] DS: hash, sort, array/vector, map, set.
  • [x] Math: rand, noise, ease, vec2/3/4, mat33/34/44, quat.
  • [x] Geometry: ray, line, plane, aabb, sphere, capsule, triangle, poly and frustum.
  • [x] Window: windowed, soft/hard fullscreen, msaa, icon, cursor handling.
  • [x] Input: keyboard, mouse and gamepads.
  • [x] Script: Lua scripting, Luajit bindings.
  • [x] Network: downloads (HTTPS) and sockets (TCP/UDP).
  • [x] AI: Swarm/Boids.
  • [x] UI: button, list, slider, toggle, checkbox, editbox, dialog, color, image, menu, window, notify…
  • [x] Font: TTF, OTF and TTC. Basic syntax highlighter. Glyph ranges. Atlasing.
  • [x] Localization/I18N: XLSX and INI. Unicode.
  • [x] Image: JPG, PNG, BMP, PSD, PIC, PNM, ICO.
  • [x] Texture: KTX/2, PVR, DDS, ASTC, BASIS, HDR, TGA.
  • [x] Texel: Depth, R, RG, RGB, RGBA, BC1/2/3/4/5/6/7, PVRI/II, ETC1/2, ASTC.
  • [x] Audio: WAV/FLAC, OGG/MP1/MP3, FUR, MOD/XM/S3M/IT, SFXR and MID+SF2/SF3.
  • [x] Video: MP4, MPG, OGV, MKV, WMV and AVI. Also, MP4 recording with MPEG-1 fallback.
  • [x] Model: IQM/E, GLTF/2, GLB, FBX, OBJ, DAE, BLEND, MD3/5, MS3D, SMD, X, 3DS, BVH, DXF, LWO.
  • [x] Render: PBR (metallic-roughness) workflow.
  • [x] Render: Cubemaps, panoramas and spherical harmonics. Rayleigh/Mie scattering.
  • [x] Render: Post-effects (SSAO,FXAA1/3,CRT,Contrast,Grain,Outline,Vignette…).
  • [x] Render: 3D Anims, skeletal anims, hardware skinning and instanced rendering.
  • [x] Render: 3D Debugdraw, batching and vectorial font.
  • [x] Render: 2D Sprites, spritesheets, AA zooming and batching.
  • [x] Render: 2D Tilemaps and tilesets: TMX, TSX.
  • [x] Compression: DEFLATE, LZMA, LZ4, ULZ, BALZ, BCM, CRUSH, LZW3, LZSS and PPP.
  • [x] Virtual filesystem: ZIP, PAK, TAR and DIR.
  • [x] Level data: JSON, JSON5, SJSON, XML, INI.
  • [x] Disk cache.
  • [x] Scene handling.
  • [x] Profiler, stats and leaks finder.
  • [x] Editor (wip).
  • [x] Documentation (wip).

Hello FWK

#include "fwk.h" // Minimal C sample
int main() {
    window_create(75.0, 0); // 75% size, no extra flags
    while( window_swap() && !input(KEY_ESC) ) { // game loop
        puts("hello FWK from C!");
    }
}
#include "fwk.h" // Minimal HTML5 sample
void render(void *arg) {
    if( !input(KEY_ESC) ) puts("hello FWK from HTML5!");
}
int main() {
    window_create(75.0, 0); // 75% size, no extra flags
    window_loop(render, NULL); // game loop
}
local fwk = require("fwk") -- Minimal Lua sample
fwk.window_create(75.0,0) -- 75% size, no extra flags
while fwk.window_swap() and fwk.input(fwk.KEY_ESC) == 0 do -- game loop
    print("hello FWK from Lua!")
end

Quickstart

  • Double-click MAKE.bat (Win) or sh MAKE.bat (Linux/OSX) to compile everything.
  • MAKE.bat sln (Win) or sh MAKE.bat sln (Linux/OSX) to generate solutions/makefiles.
  • MAKE.bat help (Win) or sh MAKE.bat help (Linux/OSX) for a bunch of options.
  • MAKE.bat hello.c (Win) or sh MAKE.bat hello.c (Linux/OSX) to build a single executable.
  • Alternatively,
echo win/vc       && cl hello.c
echo win/clang-cl && clang-cl hello.c
echo win/tcc      && tcc   hello.c -m64
echo win/mingw    && gcc   hello.c -lws2_32 -lwinmm -ldbghelp -lole32 -luser32 -lgdi32 -lcomdlg32
echo win/clang    && clang hello.c -lws2_32 -lwinmm -ldbghelp -lole32 -luser32 -lgdi32 -lcomdlg32
echo linux        && cc  hello.c -lm -ldl -lpthread -lX11
echo linux/tcc    && tcc hello.c -lm -ldl -lpthread -lX11 -D__STDC_NO_VLA__
echo osx          && cc -ObjC hello.c -framework cocoa -framework iokit -framework audiotoolbox

Cook

  • Most asset types need to be cooked before being used in your application. Some other assets like .png do not.
  • Cooked assets will be written into .zipfiles close to your executable, and mounted before entering game loop.
  • Cooked .zipfiles and your executable are the only required assets when releasing your game.
  • Cook manually your assets by invoking supplied tools/cook standalone binary.
  • Cook automatically your assets by just playing your game: a runtime cook is already embedded into your binary.
    • In order to achieve this, ensure the tools/ folder is close to your executable.
    • This folder contains all the related binaries to perform any asset conversion plus the cookbook to do so.

Extra tips

  • Any ico/png file named after the executable name will be automatically used as app icon.
  • Similar to the ico/png case above, the cooked .zipfiles can be named after the main executable as well.
  • Dropped files into game window will be imported & saved into import/ folder.
  • Update the gamepad controller database by upgrading the gamecontrollerdb.txt file.
  • Depending on your IDE, you might need to browse to engine/split/ sources when debugging FWK.
  • Cook assets on demand, as opposed to cook all existing assets on depot, by using --cook-on-demand flag.
  • Linux/OSX users can optionally install wine and use the Windows tools instead (by using --cook-wine flag).
  • Disable automatic cooking by using --cook-jobs=0 flag (not recommended).
  • Generate a project solution by dropping engine/fwk.h, fwk.c and fwk files into it, or MAKE.bat sln.
  • Much faster builds by typing MAKE.bat tcc (Win/Linux). Beware: compiler has no thread-locals support.

Bindings

Credits (Artwork + demos)

Credits (Tools)

Credits (Runtime)

Unlicense

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.

Links

Issues Discord

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, olive.c, opensource, ouzel, pez, pixie, punity, r96, ricotech, rizz, tigr, yourgamelib