diff mde/gui/Gui.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 928db3c75ed3
children 5132301e9ed7
line wrap: on
line diff
--- a/mde/gui/Gui.d	Fri May 02 16:20:35 2008 +0100
+++ b/mde/gui/Gui.d	Fri May 02 17:38:43 2008 +0100
@@ -27,6 +27,11 @@
 import mde.gui.renderer.createRenderer;
 import mde.gui.exception;
 
+// For adding the input event callbacks and requesting redraws:
+import imde = mde.imde;
+import mde.input.Input;
+import mde.scheduler.Scheduler;
+
 // For loading from file:
 import mt = mde.mergetag.DataSet;
 import mt = mde.mergetag.DefaultData;
@@ -95,6 +100,9 @@
                 logger.error ("Window failed to load: " ~ e.msg);
             }
         }
+        
+        imde.input.addMouseClickCallback(&clickEvent);
+        imde.input.addMouseMotionCallback(&motionEvent);
     }
     //END Loading code
     
@@ -145,6 +153,10 @@
         return rend;
     }
     
+    void requestRedraw () {
+        imde.mainSchedule.request(imde.SCHEDULE.DRAW);
+    }
+    
     void addClickCallback (void delegate(ushort, ushort, ubyte, bool) dg) {
         clickCallbacks[dg.ptr] = dg;
     }