void ExampleBrowserThreadFunc(void* userPtr,void* lsMemory) { printf("thread started\n"); ExampleBrowserThreadLocalStorage* localStorage = (ExampleBrowserThreadLocalStorage*) lsMemory; ExampleBrowserArgs* args = (ExampleBrowserArgs*) userPtr; int workLeft = true; b3CommandLineArgs args2(args->m_argc,args->m_argv); b3Clock clock; ExampleEntries examples; examples.initExampleEntries(); ExampleBrowserInterface* exampleBrowser = new DefaultBrowser(&examples); bool init = exampleBrowser->init(args->m_argc,args->m_argv); clock.reset(); if (init) { do { float deltaTimeInSeconds = clock.getTimeMicroseconds()/1000000.f; clock.reset(); exampleBrowser->update(deltaTimeInSeconds); } while (!exampleBrowser->requestedExit() && (args->m_cs->getSharedParam(0)!=eRequestTerminateExampleBrowser)); } delete exampleBrowser; args->m_cs->lock(); args->m_cs->setSharedParam(0,eExampleBrowserHasTerminated); args->m_cs->unlock(); printf("finished\n"); //do nothing }
int main(int argc, char* argv[]) { b3CommandLineArgs args(argc,argv); b3Clock clock; ExampleEntriesAll examples; examples.initExampleEntries(); ExampleBrowserInterface* exampleBrowser = new DefaultBrowser(&examples); bool init = exampleBrowser->init(argc,argv); clock.reset(); if (init) { do { float deltaTimeInSeconds = clock.getTimeMicroseconds()/1000000.f; clock.reset(); exampleBrowser->update(deltaTimeInSeconds); } while (!exampleBrowser->requestedExit()); } delete exampleBrowser; return 0; }