Esempio n. 1
0
/*!
 @param argc command line argument count
 @param argv tokenized arguments: load files, set parameters. 
		Get help, run 'antz ?' to see a list of command line arguments.
 @return 0 if exited normally, otherwise returns an error number which is 
		generated by the OS application framework.
*/
int main (int argc, char **argv)
{
/*! --------------------------------------------------------------------------
*  MVC architecture variant where View becomes a subset of the IO group.
*  Model named Data (map) is a global Scene Graph.
*  View named IO, includes keyboard, mice, haptic devices, audio, video...
*  Control named Ctrl, an event driven pseudo state-machine based on physics.
*
*  Ctrl modifies the scene state and the Neural Physics Engine updates it.
*  Platform specific functions are separately placed in the 'os' subfolders.
*
*  Currently only a single (global) dataRef instance is used, but expect that
*  multiple instances will be created to support several users and GL contexts.
*
*  CPU load is currently 15% NPE, 5% qsort, 80% GL commands.
*  Greatest performance gain would be to make the GL code run in parallel.
*  main() can be compiled as either C or C++
* --------------------------------------------------------------------------- */

	int err = 0;
	void* data = NULL;

	data = npInitData (argc, argv);			/// Model named - map
	npInitIO (data);						/// View called - io
	npInitCtrl (data);						/// Control -> ctrl

	err = npAppLoop (data);					/// enter main app loop

	npCloseCtrl (data);						/// halt ctrl
	npCloseIO (data);						/// release io
	npCloseData (data);						/// destroy map

	return err;
}
Esempio n. 2
0
File: main.cpp Progetto: jsale/antz
/* ---------------------------------------------------------------------------
*  MVC architecture variant where View becomes a subset of the IO group
*  Model named Data (map) is a global scene graph
*  View named IO, includes keyboard, mice, haptic devices, audio, video...
*  Control named Ctrl, a pseudo state-machine based on physics, excludes IO
*
*  Ctrl modifies the scene state and the Neural Physics Engine updates it.
*  Platform specific functions are separately placed in the 'os' subfolders.
*
*  Currently only a single (global) dataRef instance is used, but expect that
*  multiple instances will be created to support several users and GL contexts.
*
*  CPU load is currently 15% NPE, 5% qsort, 80% GL commands
*  main() can be compiled as either C or C++
* --------------------------------------------------------------------------- */
int main (int argc, char **argv)
{
	int err = 0;

	void* data = NULL;	

	data = npInitData (argc, argv);			// Model
	npInitIO (data);						// View
	npInitCtrl (data);						// Control

	err = npAppLoop (data);

	npCloseCtrl (data);
	npCloseIO (data);
	npCloseData (data);

	return err;
}