Mercurial > projects > mde
comparison mde/mde.d @ 102:ba035eba07b4
Compilation fixes for windows and unittest code.
author | Cyborg16@cyborg64-win.lan |
---|---|
date | Sat, 22 Nov 2008 20:59:36 +0000 |
parents | 49e7cfed4b34 |
children | 42e241e7be3e |
comparison
equal
deleted
inserted
replaced
101:71f0f1f83620 | 102:ba035eba07b4 |
---|---|
1 /* LICENSE BLOCK | 1 /* LICENSE BLOCK |
2 Part of mde: a Modular D game-oriented Engine | 2 Part of mde: a Modular D game-oriented Engine |
3 Copyright © 2007-2008 Diggory Hardy | 3 Copyright © 2007-2008 Diggory Hardy |
4 | 4 |
5 This program is free software: you can redistribute it and/or modify it under the terms | 5 This program is free software: you can redistribute it and/or modify it under the terms |
6 of the GNU General Public License as published by the Free Software Foundation, either | 6 of the GNU General Public License as published by the Free Software Foundation, either |
41 import mde.font.font; | 41 import mde.font.font; |
42 class SimpleDrawable : Screen.IDrawable { | 42 class SimpleDrawable : Screen.IDrawable { |
43 this () { | 43 this () { |
44 msg = "Welcome to mde.\nThis executable is only for testing, and\nas such doesn't do anything interesting."; | 44 msg = "Welcome to mde.\nThis executable is only for testing, and\nas such doesn't do anything interesting."; |
45 debug msg ~= "\nRunning in debug mode."; | 45 debug msg ~= "\nRunning in debug mode."; |
46 font = FontStyle.get("default");// get the default or fallback font | 46 font = FontStyle.getDefault; // get the default or fallback font |
47 } | 47 } |
48 void sizeEvent (int,int) {}; // Don't care what the size is | 48 void sizeEvent (int,int) {}; // Don't care what the size is |
49 void draw () { | 49 void draw () { |
50 font.textBlock (16,32, msg, textCache, Colour.WHITE); | 50 font.textBlock (16,32, msg, textCache, Colour.WHITE); |
51 } | 51 } |
79 * be called at the end to optimise. */ | 79 * be called at the end to optimise. */ |
80 mainSchedule.add (SCHEDULE.DRAW, &Screen.draw).request = true; // Draw, per event and first frame only. | 80 mainSchedule.add (SCHEDULE.DRAW, &Screen.draw).request = true; // Draw, per event and first frame only. |
81 mainSchedule.add (mainSchedule.getNewID, &mde.events.pollEvents).frame = true; | 81 mainSchedule.add (mainSchedule.getNewID, &mde.events.pollEvents).frame = true; |
82 //END Main loop setup | 82 //END Main loop setup |
83 | 83 |
84 double pollInterval = miscOpts.pollInterval(); | |
84 while (run) { | 85 while (run) { |
85 mainSchedule.execute (Clock.now()); | 86 mainSchedule.execute (Clock.now()); |
86 | 87 |
87 Thread.sleep (miscOpts.pollInterval); // sleep this many seconds | 88 Thread.sleep (pollInterval); // sleep this many seconds |
88 } | 89 } |
89 | 90 |
90 return 0; // cleanup handled by init's DTOR | 91 return 0; // cleanup handled by init's DTOR |
91 } | 92 } |