summaryrefslogtreecommitdiffstats
path: root/test/src/test-osg.cpp
blob: a3fcdc69b44e932ed5c2bf03edd5a67697a9878d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>

#include "uscxml/concurrency/tinythread.h"

tthread::thread* thread;
osgViewer::Viewer viewer;

void run(void* instance) {
	osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile("/Users/sradomski/Documents/TK/Projects/SmartVortex/Code/FE-Design/data/sv_processed/HARD_MP_VAL_000.wrl.osgb");
	viewer.setSceneData(loadedModel.get());

//  viewer.startThreading();
	viewer.run();
}


int main(int argc, char** argv) {
	viewer.setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
	viewer.realize();
	thread = new tthread::thread(run, NULL);
	while(true) {
		tthread::this_thread::sleep_for(tthread::chrono::microseconds(1000));
//    viewer.eventTraversal();
	}
}