add initial examples, replacing the 'Demos/Demos3'. Will make it work cross-platform, OpenGL3/OpenGL2 and add more examples to it.
This commit is contained in:
39
examples/ExampleBrowser/main.cpp
Normal file
39
examples/ExampleBrowser/main.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
//#define EXAMPLE_CONSOLE_ONLY
|
||||
#ifdef EXAMPLE_CONSOLE_ONLY
|
||||
#include "EmptyBrowser.h"
|
||||
typedef EmptyBrowser DefaultBrowser;
|
||||
#else
|
||||
#include "OpenGLExampleBrowser.h"
|
||||
typedef OpenGLExampleBrowser DefaultBrowser;
|
||||
#endif //EXAMPLE_CONSOLE_ONLY
|
||||
|
||||
#include "Bullet3Common/b3CommandLineArgs.h"
|
||||
#include "../Utils/b3Clock.h"
|
||||
|
||||
#include "ExampleEntries.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
b3CommandLineArgs args(argc,argv);
|
||||
b3Clock clock;
|
||||
|
||||
ExampleEntries examples;
|
||||
examples.initExampleEntries();
|
||||
|
||||
ExampleBrowserInterface* exampleBrowser = new DefaultBrowser(&examples);
|
||||
bool init = exampleBrowser->init(argc,argv);
|
||||
if (init)
|
||||
{
|
||||
do
|
||||
{
|
||||
float deltaTimeInSeconds = 1./120.f;
|
||||
exampleBrowser->update(deltaTimeInSeconds);
|
||||
|
||||
} while (!exampleBrowser->requestedExit());
|
||||
}
|
||||
delete exampleBrowser;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user