#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
Quickstart
Double-click MAKE.bat (Win) or sh MAKE.bat (Linux/OSX) to quick start.
MAKE.bat all (Win) or sh MAKE.bat all (Linux/OSX) to build everything.
MAKE.bat proj (Win) or sh MAKE.bat proj (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.
Assets need to be cooked before being consumed in your application. The tools/ folder contains all the related binaries to perform any asset processing plus the cookbook to do so.
Your game will cook your assets on demand as long as the tools/ folder is next to your executable. Alternatively, cook them all just by invoking supplied tools/cook standalone binary.
In both cases, assets will be cooked and packed into .zipfiles next to your executable, then mounted before entering game loop. These .zipfiles plus your executable are the only required files when releasing your game.
Optionally, you could also run MAKE.bat fuse and merge your binaries and their .zipfiles all together. Redist ready.
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 all existing assets on depot, as opposed to cook assets on demand, by using --cook-on-demand=0 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.
Auto-generated Luajit and Python bindings can be found in the engine/ folder.
Windows Defender may tag as false positives some generated binaries with tcc. Use make tcc static instead.
Bindings
Auto-generated LuaJIT and Python bindings can be found in this folder.
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.