diff example/cube/main.cpp @ 0:df32980116bd

Initial revision
author gongo
date Sat, 02 Feb 2008 19:15:39 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/cube/main.cpp	Sat Feb 02 19:15:39 2008 +0900
@@ -0,0 +1,23 @@
+int
+main()
+{
+    CubeSceneGraph scg[2];
+    TaskID wait = 0;
+    TaskID wait2 = 0;
+    int phase = 0;
+
+    scg[0] = new CubeSceneGraph("cube.xml");
+    scg[1] = scg[0]->copy();
+
+    // OPENGL, SHARED, DATAPACK, CELL
+    RenderingEngine *engine = RenderingEngineFactory(OPENGL);
+    engine->init(width, height, bpp);
+
+    while (1) {
+	wait = engine->update_all(scg[1-phase], scg[phase], wait);
+	//scg[1-phase]->update_all(scg[phase]);
+	wait2 = engine->draw_all(scg[phase], wait2);
+	//scg[phase]->draw_all(engine);
+	phase ^= 1;
+    }
+}