Embedding breve In Another Program
To implement a custom application frontend, or to use breve simulations as part of another program, you'll need to familiarize yourself with functions relating to the breve engine structure
brEngine.
-
Create and initialize the breve engine (
brEngineNew)Call
brEngineNew()to get a breve engine. You may optionally pass in command-line arguments using the alternative functionbrEngineNewWithArguments( argc, argv ). After creating the engine, initialize the standard frontend languages usingbrInitFrontendLanguages( engine )engine = brEngineNew(); brInitFrontendLanguages( engine );
-
Add breve file search paths using
brAddSearchPath( engine, path ). The search paths must be properly initialized so that breve can locate the standard class files.brAddSearchPath( engine, "lib/classes/breve" ); brAddSearchPath( engine, "lib/classes/mybreveclasses" );
-
Start a simulation using
brLoadSimulation.brLoadSimulation( engine, simulationText, simulationFilename );
-
Iterate the breve engine (
brEngineIterate) repeatedly in your program's execution loop.brEngineIterate( engine );
