comparison mde/gui/renderer/createRenderer.d @ 32:316b0230a849

Lots more work on the GUI. Also renamed lots of files. Lots of changes to the GUI. Renderer is now used exclusively for rendering and WidgetDecoration is gone. Renamed lots of files to conform to case policies. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Wed, 30 Apr 2008 18:05:56 +0100
parents
children
comparison
equal deleted inserted replaced
31:baa87e68d7dc 32:316b0230a849
1 /* LICENSE BLOCK
2 Part of mde: a Modular D game-oriented Engine
3 Copyright © 2007-2008 Diggory Hardy
4
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
7 version 2 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 See the GNU General Public License for more details.
12
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/>. */
15
16 /** This module allows any renderer to be created from a string parameter. */
17 module mde.gui.renderer.createRenderer;
18
19 public import mde.gui.renderer.IRenderer;
20 import mde.gui.renderer.SimpleRenderer;
21
22 import tango.util.log.Log : Log, Logger;
23
24 private Logger logger;
25 static this () {
26 logger = Log.getLogger ("mde.gui.renderer.createRenderer");
27 }
28
29 /** Return an instance of renderer name.
30 *
31 * If name does not match any renderer class, SimpleRenderer is used as a default. */
32 IRenderer createRenderer (char[] name) {
33 if (name == "Simple") return new SimpleRenderer;
34 else {
35 logger.warn ("Renderer name \"" ~ name ~ "\" is not recognised. Defaulting to SimpleRenderer.");
36 return new SimpleRenderer;
37 }
38 }