diff mde/mde.d @ 25:2c28ee04a4ed

Some minor and some futile efforts. Played around with init functions, had problems, gave up and put them back. Removed idea for multiple init stages; it's not good for performance or simplicity. Adjusted exception messages. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 03 Apr 2008 17:26:52 +0100
parents 32eff0e01c05
children 611f7b9063c6
line wrap: on
line diff
--- a/mde/mde.d	Thu Mar 27 16:15:21 2008 +0000
+++ b/mde/mde.d	Thu Apr 03 17:26:52 2008 +0100
@@ -15,29 +15,24 @@
 
 /** Modular D Engine
  *
- * This module contains main().
+ * This module contains main(), which calls Init and runs the main loop.
  */
 module mde.mde;
 
-// Package imports
-import global = mde.global;
-import mde.events;
-import mde.exception;
+// Comment to show use, where only used minimally:
 
-import mde.SDL; // This module is ONLY imported because otherwise it wouldn't be compiled in
+import global = mde.global;             // global.run
+import mde.SDL;                         // unused (but must be linked in)
+import mde.events;                      // unused (but must be linked in)
 
 import mde.scheduler.Init;
-import mde.scheduler.runTime;
-import mde.scheduler.exception;
-
-import mde.input.input;
+import mde.scheduler.runTime;           // Scheduler.run()
+import mde.scheduler.exception;         // InitException
 
-import tango.core.Thread : Thread;	// for sleep
-import tango.time.Clock;
+import tango.core.Thread : Thread;	// Thread.sleep()
+import tango.time.Clock;                // Clock.now()
 import tango.util.log.Log : Log, Logger;
 
-import derelict.sdl.sdl;
-
 int main()
 {
     //BEGIN Initialisation
@@ -48,17 +43,9 @@
     try {
         init = new Init();	// initialisation
     } catch (InitException e) {
-        logger.fatal ("Initialisation failed; error was:");
-        logger.fatal (e.msg);
+        logger.fatal ("Initialisation failed: " ~ e.msg);
         return 1;
     }
-    
-    global.input.addButtonCallback (cast(Input.inputID) 0x0u, delegate void(Input.inputID i, bool b) {
-        if (b) {
-            logger.info ("Quiting...");
-            global.run = false;
-        }
-    } );
     //END Initialisation
     
     while (global.run) {