Engine Main
Slice doesn't specify main
, originally the thought process was this would be too heavy-handed and that the app should control the game engine (not the other way around), yet slQuit forcefully exits the entire program. Either the engine should have its own main
and the app should be passively started by it, or slQuit should not exit.
Or, generating an engine main
could be optional and configured by a utility inside the builder image. This utility could also generate a Makefile for the app linking to the appropriate libraries, and only calling the necessary Init
and Quit
's, and only making available the headers of, libraries passed as either arguments or as a configuration file. In the case of not generating a main
, slInit and slQuit should include initialization and shutdown for all the components, not just core Slice.
Example:
// Slice App Builder JSON
{
"components":[
"slicecore",
"sliceui",
"sliceopts",
"slice2d",
"sliceptcl",
"slicephys2d"
]
}
// Slice Gameserver Builder JSON
{
"components":[
"slicecore"
],
"engine_main": false // instead of generating an engine main, slInit and slQuit will be generated.
}