Mercurial > projects > mde
comparison mde/mde.d @ 89:97e6dce08037
Solved some/removed some obsolete jobs/FIXMEs (excluding from gui code). General cleanup.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Mon, 29 Sep 2008 18:27:17 +0100 |
parents | 79d816b3e2d2 |
children | 2a364c7d82c9 |
comparison
equal
deleted
inserted
replaced
88:01f4f5f1acc9 | 89:97e6dce08037 |
---|---|
19 * and some other testing. It also serves as a basic example program. | 19 * and some other testing. It also serves as a basic example program. |
20 */ | 20 */ |
21 module mde.mde; | 21 module mde.mde; |
22 | 22 |
23 import mde.imde; // this module's interface for external modules | 23 import mde.imde; // this module's interface for external modules |
24 import mde.events; // pollEvents() // NOTE: Must be imported before Init, otherwise fonts don't display properly (why??) | |
25 import mde.setup.Init; // initialization | 24 import mde.setup.Init; // initialization |
25 import mde.setup.Screen; // Screen.draw() | |
26 import mde.events; // pollEvents() | |
26 import mde.lookup.Options; // pollInterval option | 27 import mde.lookup.Options; // pollInterval option |
27 import mde.scheduler.Scheduler; // mainSchedule | 28 import mde.scheduler.Scheduler; // mainSchedule |
28 import mde.setup.Screen; // Screen.draw() | |
29 | 29 |
30 import tango.core.Thread : Thread; // Thread.sleep() | 30 import tango.core.Thread : Thread; // Thread.sleep() |
31 import tango.time.Clock; // Clock.now() | 31 import tango.time.Clock; // Clock.now() |
32 import tango.util.log.Log : Log, Logger; | 32 import tango.util.log.Log : Log, Logger; |
33 debug (mdeUnitTest) { // These modules contain unittests which wouldn't be run otherwise. | 33 debug (mdeUnitTest) { // These modules contain unittests which wouldn't be run otherwise. |
67 scope Init init = new Init(args); // initialize mde | 67 scope Init init = new Init(args); // initialize mde |
68 | 68 |
69 // Note: must create the drawable after init, since it uses font (initialized in init). | 69 // Note: must create the drawable after init, since it uses font (initialized in init). |
70 Screen.addDrawable (new SimpleDrawable); // a drawable to print a message. | 70 Screen.addDrawable (new SimpleDrawable); // a drawable to print a message. |
71 | 71 |
72 // Make sure pollInterval has a sane value. FIXME: get Options class to enforce range | |
73 if (miscOpts.pollInterval !<= 1.0 || miscOpts.pollInterval !>= 0.0) | |
74 miscOpts.set!(double) ("pollInterval", 0.01); | |
75 | |
76 //BEGIN Main loop setup | 72 //BEGIN Main loop setup |
77 /* Note: the main loop is currently controlled by the scheduler. This is not really ideal, | 73 /* Note: the main loop is currently controlled by the scheduler. This is not really ideal, |
78 * since it provides no direct control of the order in which components are executed and does | 74 * since it provides no direct control of the order in which components are executed and does |
79 * not allow running components simultaeneously with threads. | 75 * not allow running components simultaeneously with threads. |
80 * Note: probably drawing should start at the beginning of the loop and glFlush()/swapBuffers | 76 * Note: probably drawing should start at the beginning of the loop and glFlush()/swapBuffers |