8000 GitHub - rastargame/FWK: 3D game framework in C.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rastargame/FWK

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D game framework in C.


Goals

  • C++. C.
  • Fast. Naive.
  • Modern. Simple.
  • Full featured. Small.
  • Royaltie fee. Free and unlicensed.

Features ᕦ(ᐛ)ᕤ (stuff done and yet to be done)

  • OS: Windows, Linux and OSX.
  • Compiler: MSVC, MINGW64, TCC, GCC and clang.
  • Window: windowed, fullscreen, msaa, icon, cursor handling.
  • Input: keyboard, mouse and gamepads.
  • Script: Lua, bindings and FFI.
  • Network: downloads (HTTPS), sockets (TCP/UDP) and messages (enet/websocket).
  • UI: color3/4, button, list, slider, toggle, checkbox, editbox, dialog, menus.
  • Math: rand, noise, ease, vec2/3/4, mat33/34/44, quat and quat2, bezier, catmull.
  • Geometry: ray, line, plane, aabb, sphere, capsule, triangle, poly and frustum.
  • Image: JPG, PNG, TGA, BMP, PSD, HDR, PIC, PNM and GIF.
  • Texture: BCn 1/2/3/4/5/6/7, DDS, KTX, PVR, PKM, ETC.
  • Audio: WAV, MOD, XM, FLAC, OGG, MP1, MP3, MID and SFXR.
  • Video: MP4, MPG, OGV, MKV, WMV and AVI.
  • Model: IQM, GLTF/2, FBX, OBJ, DAE, BLEND, MD3, MD5, MS3D, SMD, X, 3DS, BVH, DXF, LWO.
  • Render: 2D Sprites, spritesheets, batching, tiled and 2D Spines.
  • 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...) and shadertoys.
  • Compression: DEFLATE, LZMA, LZ4, ULZ, BALZ, BCM, CRUSH, LZW3, LZSS and PPP.
  • Virtual filesystem: ZIP, PAK, TAR and DIR.
  • Disk cache.
  • Scene handling.
  • Integrated asset pipeline.
  • Profiler, stats and leaks finder.
  • Level data: JSON, JSON5, SJSON, XML.

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

  • API: Documentation generator, during cook stage.
  • Network: socketless api. NAT traversal. also, message api and pub/sub wrappers (enet/websocket).
  • Render: Materials (colors, textures*, matcaps*, videos*, shadertoys*).
  • Render: Flags (billboards *, un/lit). Hard/soft shadow mapping and baked lightmaps.
  • Level editor: gizmos*, scene tree, property editor, load/save, undo/redo, copy/paste.
  • Level objects: volumes*, triggers, platforms, streaming.
  • Script: DLL*, Lua*, Teal and TypeScript.
  • Script: Refl/meta binding tool (during cook stage).
  • Pipeline: Extend: shaders, bindings, textures. Per-platform, per-type, per-asset options.
  • Pipeline: Atlassing (sprite/lightmaps). Fit packing (fonts/sprites).
  • Pipeline: Make asset pipeline configurable (maybe move/override logic to external scripts?).
  • Maybe: Animation pass.
  • Maybe: AI/Logic pass.
  • Maybe: Lighting/PBR pass.
  • Maybe: VM/ECS/Replication pass.
  • API: More examples. Also, less examples.
  • API: Review API, clean it up and lock it.
  • API: Document.

Build

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.

Amalgamation

  • Split FWK into separate files by running art/tools/split.bat (or sh art/tools/split.bat in Linux/OSX).
  • Merge those files back into FWK by running art/tools/join.bat (or sh art/tools/join.bat in Linux/OSX).
  • Optionally, generate a single-header distribution by executing following script:
type fwk.h            > fwk-single-header.h
echo #ifdef FWK_C    >> fwk-single-header.h
echo #pragma once    >> fwk-single-header.h
type fwk.c           >> fwk-single-header.h
echo #endif // FWK_C >> fwk-single-header.h

Extra tips

  • Dropped files into game window will be imported & saved in art/import folder.
  • Linux/OSX users can optionally install wine to use the Windows pipeline as an alternate asset pipeline.
  • Depending on your IDE, you might need to split all amalgamated files when debugging FWK.

License

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.

Credits (Artwork + demos)

  • 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)

Links

Issues Discord

Still looking for alternatives? amulet, aroma, astera, blendelf, bullordengine, candle, cave, chickpea, corange, cute, ejoy2d, exengine, gunslinger, hate, island, juno, l, lgf, limbus, love, lovr, mini3d, mintaro, mio, opensource, pez, pixie, punity, ricotech, rizz, tigr,

About

3D game framework in C.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 73.8%
  • C++ 24.6%
  • GLSL 0.7%
  • Lua 0.6%
  • HTML 0.3%
  • CSS 0.0%
0