diff mde/scheduler/init2.d @ 36:57d000574d75

Enabled drawing on demand, and made the polling interval configurable. Renamed mde.global to mde.imde. Enabled drawing on demand. Allowed options to take double values. Made the main loop's polling interval (sleep duration) settable from config files. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 02 May 2008 17:38:43 +0100
parents 6b4116e6355c
children 5132301e9ed7
line wrap: on
line diff
--- a/mde/scheduler/init2.d	Fri May 02 16:20:35 2008 +0100
+++ b/mde/scheduler/init2.d	Fri May 02 17:38:43 2008 +0100
@@ -32,7 +32,7 @@
 import tango.util.log.Log : Log, Logger;
 
 // Modules requiring init code running:
-import global = mde.global;
+import imde = mde.imde;
 import mde.gui.Gui;
 import mde.input.Input;
 import ft = mde.ft.init;
@@ -59,20 +59,15 @@
 
 void initInput () { // init func
     try {
-        global.input = new Input();
-        global.input.loadConfig ();         // (may also create instance)
+        imde.input.loadConfig ();         // (may also create instance)
         
         // Quit on escape. NOTE: quit via SDL_QUIT event is handled completely independently!
-        global.input.addButtonCallback (cast(Input.inputID) 0x0u, delegate void(Input.inputID i, bool b) {
+        imde.input.addButtonCallback (cast(Input.inputID) 0x0u, delegate void(Input.inputID i, bool b) {
             if (b) {
                 logger.info ("Quiting...");
-                global.run = false;
+                imde.run = false;
             }
         } );
-        
-        // Aught to be added by the gui, but it doesn't know if input exists then.
-        global.input.addMouseClickCallback(&gui.clickEvent);
-        global.input.addMouseMotionCallback(&gui.motionEvent);
     } catch (Exception e) {
         logger.fatal ("initInput failed: " ~ e.msg);
         setInitFailure;