diff examples/guiDemo.d @ 137:9f035cd139c6

BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed. Content restrutured a lot: New IContent module, Content module includes more functionality. New ContentLoader module to manage content loading/saving/translation. Translation module moved to content dir and cut down to reflect current usage. File format unchanged except renames: FontOptions -> Font, VideoOptions -> Screen. Font render mode and LCD filter options are now enums. GUI loading needs to create content (and set type for enums), but doesn't save/load value. Some setup of mainSchedule moved to mde.mainLoop. Content callbacks are called on content change now. ContentLists are set up implicitly from content symbols. Not as fast but much easier! Bug-fix in the new MTTagReader. Renamed MT *Reader maker functions to avoid confusion in paths.d. New mde.setup.logger module to allow logger setup before any other module's static this().
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 07 Feb 2009 12:46:03 +0000
parents 264028f4115a
children a1ba9157510e
line wrap: on
line diff
--- a/examples/guiDemo.d	Sun Feb 01 12:36:21 2009 +0000
+++ b/examples/guiDemo.d	Sat Feb 07 12:46:03 2009 +0000
@@ -16,11 +16,10 @@
 /** Main module for a gui demo & testing executable. */
 module examples.guiDemo;
 
-import mde.imde;                        // this module's interface for external modules
-import mde.menus;		// add default menus
-import mde.events;      // pollEvents() // NOTE: Must be imported before Init, otherwise fonts don't display properly (why??)
+import mde.imde;
+import mde.mainLoop;			// Some setup for the main loop
+import mde.menus;			// add default menus
 import mde.setup.Init;                  // initialization
-import mde.lookup.Options;              // pollInterval option
 import mde.scheduler.Scheduler;         // mainSchedule
 import mde.setup.Screen;                // Screen.draw()
 import mde.setup.InitStage;             // StageState
@@ -29,10 +28,6 @@
 import tango.core.Thread : Thread;	// Thread.sleep()
 import tango.time.Clock;                // Clock.now()
 import tango.util.log.Log : Log, Logger;
-debug (mdeUnitTest) {
-    import mde.file.ssi;
-    import mde.file.mergetag.mdeUT;
-}
 
 int main(char[][] args)
 {
@@ -57,21 +52,12 @@
     
     scope Init init = new Init(args);	// initialize mde
     
-    //BEGIN Main loop setup
-    /* Note: the main loop is currently controlled by the scheduler. This is not really ideal,
-     * since it provides no direct control of the order in which components are executed and does
-     * not allow running components simultaeneously with threads.
-     * Note: probably drawing should start at the beginning of the loop and glFlush()/swapBuffers
-     * be called at the end to optimise. */
     mainSchedule.add (SCHEDULE.DRAW, &Screen.draw).request = true;      // Draw, per event and first frame only.
-    mainSchedule.add (mainSchedule.getNewID, &mde.events.pollEvents).frame = true;
-    //END Main loop setup
     
-    double pollInterval = miscOpts.pollInterval();
     while (run) {
 	mainSchedule.execute (Clock.now());
 	
-	Thread.sleep (pollInterval);	// sleep this many seconds
+        Thread.sleep (mainInterval);	// sleep this many seconds
     }
     
     return 0;		// cleanup handled by init's DTOR