comparison mde/setup/InitStage.d @ 132:264028f4115a

Cleaned up mde.imde and a couple of widget functions. New mde.menus module to add default menus. The input singleton is now created in mde.input.Input instead of mde.imde.
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 23 Jan 2009 14:59:05 +0000
parents 1655693702fc
children
comparison
equal deleted inserted replaced
131:9cff74f68b84 132:264028f4115a
11 See the GNU General Public License for more details. 11 See the GNU General Public License for more details.
12 12
13 You should have received a copy of the GNU General Public License 13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
15 15
16 /************************************************************************************************** 16 /******************************************************************************
17 * The infrastructure for handling external startup/shutdown code. 17 * The infrastructure for handling external startup/shutdown code.
18 *************************************************************************************************/ 18 *****************************************************************************/
19 module mde.setup.InitStage; 19 module mde.setup.InitStage;
20 20
21 public import mde.setup.exception; 21 public import mde.setup.exception;
22 import mde.util; 22 import mde.util;
23 23
79 } 79 }
80 Logger logger; 80 Logger logger;
81 81
82 82
83 83
84 /************************************************************************************************** 84 /******************************************************************************
85 * Initialization functions. 85 * Initialization functions.
86 *************************************************************************************************/ 86 *****************************************************************************/
87 import imde = mde.imde; 87 import imde = mde.imde;
88 import mde.input.Input; 88 import mde.input.Input;
89 import mde.setup.Screen; 89 import mde.setup.Screen;
90 import mde.input.joystick; 90 import mde.input.joystick;
91 import mde.font.font; 91 import mde.font.font;
97 addInitStage ("SWnd", &Screen.initWindow, null, ["SSDL"]); 97 addInitStage ("SWnd", &Screen.initWindow, null, ["SSDL"]);
98 addInitStage ("Font", &FontStyle.initialize, &FontStyle.cleanup); 98 addInitStage ("Font", &FontStyle.initialize, &FontStyle.cleanup);
99 } 99 }
100 100
101 StageState initInput () { 101 StageState initInput () {
102 imde.input.loadConfig ("input"); 102 Input.singleton.loadConfig ("input");
103 103
104 // Quit on escape. NOTE: quit via SDL_QUIT event is handled completely independently! 104 // Quit on escape.
105 imde.input.addButtonCallback (cast(Input.inputID) 0x0u, delegate void(Input.inputID i, bool b) { 105 Input.singleton.addButtonCallback (cast(Input.inputID) 0x0u, delegate void(Input.inputID i, bool b) {
106 if (b) { 106 if (b) {
107 logger.info ("Quiting..."); 107 debug logger.trace ("Quit (from Esc)");
108 imde.run = false; 108 imde.run = false;
109 } 109 }
110 } ); 110 } );
111 return StageState.ACTIVE; 111 return StageState.ACTIVE;
112 } 112 }