Fix for building on windows
This commit is contained in:
parent
0ba6289dbb
commit
2ae39442b4
2 changed files with 181 additions and 171 deletions
|
@ -1,40 +1,50 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Exception Class
|
* Exception Class
|
||||||
*
|
*
|
||||||
* Authors: Tim Burrell
|
* Authors: Tim Burrell
|
||||||
* Copyright: Copyright (c) 2007
|
* Copyright: Copyright (c) 2007
|
||||||
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
|
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Module
|
// Module
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
module libraryA.core.Exception;
|
module libraryA.core.Exception;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Imports
|
// Imports
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
import tango.core.Exception;
|
version (Tango)
|
||||||
|
import tango.core.Exception;
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Typedef's / Enums
|
////////////////////////////////////////////////////////////////////////////
|
||||||
///////////////////////////////////////
|
// Typedef's / Enums
|
||||||
|
///////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Exception Classes
|
////////////////////////////////////////////////////////////////////////////
|
||||||
///////////////////////////////////////
|
// Exception Classes
|
||||||
|
///////////////////////////////////////
|
||||||
/**
|
|
||||||
* PathNotFoundException Class
|
/**
|
||||||
**/
|
* PathNotFoundException Class
|
||||||
class PathNotFoundException : IOException {
|
**/
|
||||||
/// Default Constructor
|
version (Tango) {
|
||||||
this (char [] Message) {
|
class PathNotFoundException : IOException {
|
||||||
super(Message);
|
/// Default Constructor
|
||||||
}
|
this (char [] Message) {
|
||||||
}
|
super(Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
class PathNotFoundException : Exception {
|
||||||
|
/// Default Constructor
|
||||||
|
this (char [] Message) {
|
||||||
|
super(Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,131 +1,131 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Main LibraryB Class
|
* Main LibraryB Class
|
||||||
*
|
*
|
||||||
* Authors: Tim Burrell
|
* Authors: Tim Burrell
|
||||||
* Copyright: Copyright (c) 2007
|
* Copyright: Copyright (c) 2007
|
||||||
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
|
* License: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Module
|
// Module
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
module libraryB.LibraryB;
|
module libraryB.LibraryB;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Imports
|
// Imports
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
import config;
|
import config;
|
||||||
|
|
||||||
import libraryB.render.Renderer;
|
import libraryB.render.Renderer;
|
||||||
version(RendererX11) {
|
version(RendererX11) {
|
||||||
import libraryB.render.RendererX11;
|
import libraryB.render.RendererX11;
|
||||||
}
|
}
|
||||||
version(RendererWin) {
|
version(RendererWin) {
|
||||||
import libraryB.render.RendererWin;
|
import libraryB.render.RendererWindows;
|
||||||
}
|
}
|
||||||
|
|
||||||
import libraryA.io.Output;
|
import libraryA.io.Output;
|
||||||
import libraryA.mixins.HandyMixins;
|
import libraryA.mixins.HandyMixins;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Typedef's / enums
|
// Typedef's / enums
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RendererClass Enum
|
* RendererClass Enum
|
||||||
*
|
*
|
||||||
* Conditional Enum that can have different elements based on what
|
* Conditional Enum that can have different elements based on what
|
||||||
* Renderers have been selected for compilation
|
* Renderers have been selected for compilation
|
||||||
**/
|
**/
|
||||||
mixin(enumConditional!("RendererClass",
|
mixin(enumConditional!("RendererClass",
|
||||||
"RendererX11", RENDERER_X11 == "True",
|
"RendererX11", RENDERER_X11 == "True",
|
||||||
"RendererWin", RENDERER_WIN == "True"
|
"RendererWin", RENDERER_WIN == "True"
|
||||||
).createEnum());
|
).createEnum());
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Class Definition
|
// Class Definition
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the main instance of LibraryB
|
* This is the main instance of LibraryB
|
||||||
*
|
*
|
||||||
* Your program should inherit this class
|
* Your program should inherit this class
|
||||||
**/
|
**/
|
||||||
class LibraryB {
|
class LibraryB {
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Construction
|
// Construction
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
**/
|
**/
|
||||||
this() {
|
this() {
|
||||||
Out("Construct Library B");
|
Out("Construct Library B");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
**/
|
**/
|
||||||
~this() {
|
~this() {
|
||||||
Out("Destruct Library B");
|
Out("Destruct Library B");
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Public functions
|
// Public functions
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter the processing loop
|
* Enter the processing loop
|
||||||
**/
|
**/
|
||||||
void enterLoop() {
|
void enterLoop() {
|
||||||
if (mRenderer is null)
|
if (mRenderer is null)
|
||||||
throw new Exception("You must intialize LibraryB!");
|
throw new Exception("You must intialize LibraryB!");
|
||||||
|
|
||||||
// do event loop here!
|
// do event loop here!
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize LibraryB with a specific renderer
|
* Initialize LibraryB with a specific renderer
|
||||||
*
|
*
|
||||||
* Params: Renderer = Renderer to use
|
* Params: Renderer = Renderer to use
|
||||||
**/
|
**/
|
||||||
void initialize(RendererClass Renderer) {
|
void initialize(RendererClass Renderer) {
|
||||||
// allocate the renderer
|
// allocate the renderer
|
||||||
switch (Renderer) {
|
switch (Renderer) {
|
||||||
version(RendererX11) {
|
version(RendererX11) {
|
||||||
case RendererClass.RendererX11:
|
case RendererClass.RendererX11:
|
||||||
mRenderer = new RendererX11();
|
mRenderer = new RendererX11();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
version(RendererWin) {
|
version(RendererWin) {
|
||||||
case RendererClass.RendererWin:
|
case RendererClass.RendererWin:
|
||||||
mRenderer = new RendererWindows();
|
mRenderer = new RendererWindows();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
throw new Exception("Invalid Renderer Specified!");
|
throw new Exception("Invalid Renderer Specified!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize the renderer
|
// initialize the renderer
|
||||||
mRenderer.initialize();
|
mRenderer.initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Private Functions
|
// Private Functions
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Private Members
|
// Private Members
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
Renderer mRenderer; /// The renderer
|
Renderer mRenderer; /// The renderer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue