All Projects â†’ r-lyeh â†’ FWK

r-lyeh / FWK

Licence: other
💎 3D game framework in C, with Luajit bindings now.

Programming Languages

c
50402 projects - #5 most used programming language
HTML
75241 projects
C++
36643 projects - #6 most used programming language
lua
6591 projects
GLSL
2045 projects
shell
77523 projects

Projects that are alternatives of or similar to FWK

GroundEngine
Ground Engine is an easy to use Game Engine for 3D Game Development written in C++
Stars: ✭ 61 (-85.58%)
Mutual labels:  game-framework, 3d-graphics, 3d-engine
html3dutil
A public domain JavaScript library to ease developing HTML 3D apps
Stars: ✭ 29 (-93.14%)
Mutual labels:  public-domain, 3d-graphics
Yave
Yet Another Vulkan Engine
Stars: ✭ 211 (-50.12%)
Mutual labels:  pbr, 3d-graphics
framework
The exomia/framework is used for building 2D and 3D games and more inspired by the XNA/Mono framework.
Stars: ✭ 21 (-95.04%)
Mutual labels:  game-framework, 2d
Renderer
A shader-based software renderer written from scratch in C89
Stars: ✭ 1,366 (+222.93%)
Mutual labels:  pbr, 3d-graphics
Filament
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
Stars: ✭ 13,215 (+3024.11%)
Mutual labels:  pbr, 3d-graphics
Tinygizmo
📐 An immediate mode 3D gimzo (translation, rotation, scale for scene editing) in ~1200 LoC
Stars: ✭ 321 (-24.11%)
Mutual labels:  public-domain, 3d-engine
Gamedev Resources
🎼 đŸŽČ A wonderful list of Game Development resources.
Stars: ✭ 2,054 (+385.58%)
Mutual labels:  2d, 3d-engine
Strife
a simple 2d game framework
Stars: ✭ 246 (-41.84%)
Mutual labels:  game-framework, 2d
Lgf
Game development framework for Lua
Stars: ✭ 68 (-83.92%)
Mutual labels:  luajit, game-framework
Goluwa
a game framework written in luajit
Stars: ✭ 173 (-59.1%)
Mutual labels:  luajit, game-framework
Helixjs
A Javascript 3D game engine.
Stars: ✭ 84 (-80.14%)
Mutual labels:  pbr, 3d-engine
MoravaEngine
2D/3D graphics engine written in C++ language. It currently supports the following graphics APIs: OpenGL 3.3+, Vulkan 1.2, DirectX 11. Its current purpose is to experiment with various CG concepts and techniques.
Stars: ✭ 129 (-69.5%)
Mutual labels:  pbr, 3d-graphics
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+406.38%)
Mutual labels:  pbr, 3d-engine
limitless-engine
OpenGL C++ Graphics Engine
Stars: ✭ 95 (-77.54%)
Mutual labels:  pbr, 3d-graphics
speedtest
Simple bandwidth test in browser javascript
Stars: ✭ 41 (-90.31%)
Mutual labels:  public-domain, unlicense
Assetkit
🎹 Modern 2D/3D - Importer ‱ Exporter ‱ Util - Library, also called (AssetIO)
Stars: ✭ 97 (-77.07%)
Mutual labels:  3d-graphics, 3d-engine
Engine
Go 3D Game Engine
Stars: ✭ 1,362 (+221.99%)
Mutual labels:  3d-graphics, 3d-engine
Serpent
Cross-platform gaming kit in the D programming language
Stars: ✭ 140 (-66.9%)
Mutual labels:  game-framework, 2d
drawingwithcode
Drawing with code 😘
Stars: ✭ 28 (-93.38%)
Mutual labels:  2d, 3d-graphics

F·W·K

3D game framework in C, with Luajit bindings now.


Goals

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

Features ᕩ(ᐛ)á•€

  • Pipeline: configurable and integrated asset pipeline.
  • Embedded: single-file, all dependencies included.
  • Compiler: MSVC, MINGW64, TCC, GCC, clang and emscripten.
  • Linkage: Both static linkage and dynamic .dll/.so/.dylib support.
  • Platform: Windows, Linux and OSX. Partial HTML5/Web support.
  • 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, windows
  • Font: TTF, OTF and TTC. Basic syntax highlighter. Glyph ranges. Atlasing.
  • Localization/I18N: XLSX and INI. Unicode.
  • Image: JPG, PNG, BMP, PSD, PIC, PNM, ICO.
  • Texture: KTX/2, PVR, DDS, ASTC, BASIS, HDR, TGA.
  • 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. Also, MP4 recording with MPEG-1 fallback.
  • Model: IQM/E, GLTF/2, GLB, FBX, OBJ, DAE, BLEND, MD3/5, MS3D, SMD, X, 3DS, BVH, DXF, LWO.
  • Render: PBR (metallic-roughness) workflow.
  • Render: Cubemaps, panoramas and spherical harmonics. Rayleigh/Mie scattering.
  • Render: Post-effects (SSAO,FXAA1/3,CRT,Contrast,Grain,Outline,Vignette...).
  • Render: 3D Anims, skeletal anims, hardware skinning and instanced rendering.
  • Render: 3D Debugdraw, batching and vectorial font.
  • Render: 2D Sprites, spritesheets, AA zooming and batching.
  • 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, INI.
  • Disk cache.
  • Scene handling.
  • Profiler, stats and leaks finder.
  • Documentation (wip).

Roadmap ᕕ(ᐛ)ᕗ (in order of arrival; ✱: partial support)

  • Editor: gizmos✱, scene tree, property editor✱, load/save✱, undo/redo✱, copy/paste.
  • Level objects: volumes✱, triggers, platforms, streaming.
  • World: W/ECS, gameobj, serialization/merge, diff/patch.
  • 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.
  • Render: Materials (colors✱, textures✱, matcaps✱, videos✱, shadertoys✱). Shadertoys as post-fx✱.
  • Render: Hard/soft shadow mapping and baked lightmaps.
  • Script: DLL✱ (module->plugin/sys), Lua✱, Luajit✱, Teal✱ and TypeScript.
  • Network: NAT traversal. Socketless API, message API and pub/sub wrappers (enet/websocket).
  • Pipeline: Extend: shaders, bindings. Per-platform✱, per-type✱, per-asset options. GIF, PKM.
  • Pipeline: Extend atlas (sprite/lightmaps). Fit packing (sprites).
  • Pipeline: Extend bindings and messaging: parse C headers during cooking stage.
  • Maybe: AI/Logic pass.
  • Maybe: Animation pass.
  • Maybe: VM/Replication pass.
  • Maybe: Mobile/WASM/HTML5✱ pass.
  • Maybe: Lighting pass.
  • Maybe: Node/Graph editor.
  • Maybe: Tiled maps and 2D spines. Sprite parallaxs.
  • Maybe: Font text layout and shaping, underlining, soft/hard shadows, outlines.
  • API: Fewer and better examples.
  • API: Discuss API and freeze it.
  • API: Document everything.

Gallery


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!");
    }
}
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
#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
}

Build (as static library)

Type MAKE.bat static (Win) or sh MAKE.bat static (Linux/OSX) to build everything dynamically. Alternatively,

echo Win(vc)              && cl  demo.c       fwk.c
echo Win(tcc)             && tcc demo.c       fwk.c
echo Win(gcc)             && gcc demo.c       fwk.c -lws2_32 -lgdi32 -lwinmm -ldbghelp -lole32 -lcomdlg32
echo Linux(gcc+clang+tcc) && cc  demo.c       fwk.c -lm -ldl -lpthread -lX11
echo OSX(gcc+clang)       && cc  demo.c -ObjC fwk.c -framework cocoa -framework iokit
  • Note: TCC is partially supported on Windows+Linux. Beware, no threading.

Build (as dynamic library)

Type MAKE.bat dll (Win) or sh MAKE.bat dll (Linux/OSX) to build everything staticly. Alternatively,

echo Win(vc)  && cl  fwk.c /LD     /DAPI=EXPORT && cl  demo.c fwk.lib /DAPI=IMPORT
echo Win(tcc) && tcc fwk.c -shared -DAPI=EXPORT && tcc demo.c fwk.def -DAPI=IMPORT
echo Win(gcc) && gcc fwk.c -shared -DAPI=EXPORT -o fwk.dll -lws2_32 -lwinmm -ldbghelp -lole32 -lgdi32 -lcomdlg32 -Wl,--out-implib,fwk.a && gcc demo.c fwk.a -DAPI=IMPORT
echo Linux    && cc -fPIC -shared     -o libfwk.so    fwk.c -lX11 && cc demo.c libfwk.so -DAPI=IMPORT -Wl,-rpath,./
echo OSX      && cc -ObjC -dynamiclib -o libfwk.dylib fwk.c -framework cocoa -framework iokit && cc demo.c libfwk.dylib -DAPI=IMPORT

Cook

  • Most asset types need to be cooked before being used in your application. Other assets like .png do not.
  • Cooker is already embedded into you application and will scan for new contents & cook assets automatically.
  • In order to achieve this, your binary needs to keep both fwk.ini file and tools/ folder close together.
  • Cooked assets will be written into .zipfiles close to your executable, and mounted before entering game loop.
  • When distributing your game, only your binary and these .zipfiles are required.

Amalgamation

  • Depending on your IDE, you might need to split all amalgamated files when debugging FWK.
  • Split FWK into separate files by running MAKE.bat split (or sh MAKE.bat split in Linux/OSX).
  • Merge those files back into FWK by running MAKE.bat join (or sh MAKE.bat join 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.h
echo // early in **one** C compilation unit to unroll the implementation >> fwk-single-header.h
echo // The FWK_C symbol **must be defined in a C file**; C++ wont work. >> fwk-single-header.h
type art\docs\ref\3rd\3rd_glad.h >> fwk-single-header.h
type fwk.h                       >> fwk-single-header.h
echo #ifdef FWK_C                >> fwk-single-header.h
echo #pragma once                >> fwk-single-header.h
echo #define FWK_3RD             >> fwk-single-header.h
type fwk                         >> fwk-single-header.h
type fwk.c                       >> fwk-single-header.h
echo #endif // FWK_C             >> fwk-single-header.h

Extra tips

  • Any ico/png file matching the executable name will be automatically used as app icon.
  • Dropped files into game window will be imported & saved into art/import folder.
  • Update the gamepad controller database by upgrading the gamecontrollerdb.txt file.
  • Cancel entire cooking stage by pressing ESC key (not recommended).
  • Disable automatic cooking by using --with-cook-jobs=0 flag (not recommended).
  • Cook from command-line by running cook.* binaries.
  • Linux/OSX users can optionally install wine and use the Windows pipeline instead (by using --with-wine flag).
  • Generate a Visual Studio solution by dropping fwk.h, fwk.c and fwk files into it.
  • Faster builds by typing MAKE.bat tcc (Win/Linux).
  • Get smaller .exes by compiling with /Os /Ox /O2 /Oy /GL /GF /MT /DNDEBUG /Gw /link /OPT:ICF /LTCG (vc).

Bindings

Credits (Artwork + demos)

  • DavidLam, for tokamak physics engine (ZLIB).
  • 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).

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

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].