a tiny minigame engine can be built in your game or an engine, wrote in c and cpp.
only provide raw APIs, and no more actions.
because of it can be called "an engine", all the stuff (including graphic, audio, io ...) will use the host's(your engine/game) by the APIs.
also you can build and run standalone if you want.
compatibility depends on your coding, even you can run it in terminal window.
how? the answer is nope.
there's no gc or file-system, all the assets should be hard-coded as HEAD.h files.
when the your game/engine first launched, this engine should be suddenly loaded in memory for few seconds.
OR, you can use your raw assets directly.