move 'main' functions into a separate folder, to make it easier to create standalone demos (console app without gui, or opengl app, and possibly even other versions, like a software renderer, producing pictures in the cloud)

Add a line in an example cpp file to allow a standalone version.
See examples/BasicExample.cpp: B3_STANDALONE_EXAMPLE(BasicExampleCreateFunc)
This commit is contained in:
erwin coumans
2016-05-01 14:52:27 -07:00
parent 1d0f038aad
commit 984c880b2c
7 changed files with 435 additions and 247 deletions

View File

@@ -48,6 +48,17 @@ public:
};
CommonExampleInterface* StandaloneExampleCreateFunc(CommonExampleOptions& options);
#ifdef B3_USE_STANDALONE_EXAMPLE
#define B3_STANDALONE_EXAMPLE(ExampleFunc) CommonExampleInterface* StandaloneExampleCreateFunc(CommonExampleOptions& options)\
{\
return ExampleFunc(options);\
}
#else//B3_USE_STANDALONE_EXAMPLE
#define B3_STANDALONE_EXAMPLE(ExampleFunc)
#endif //B3_USE_STANDALONE_EXAMPLE
#endif //COMMON_EXAMPLE_INTERFACE_H