diff --git a/README.md b/README.md index a0e52c4b..8bb40d53 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,7 @@ Mac OSX development using Mono-D DMD, DUB, git, MonoDevelop with Mono-D plugin must be installed +In some directory, e.g. ~/src/d/ : Clone DlangUI repository @@ -188,7 +189,6 @@ Clone dependency libraries mkdir deps cd deps - git clone https://github.com/buggins/dlangui.git git clone https://github.com/DerelictOrg/DerelictUtil.git git clone https://github.com/DerelictOrg/DerelictGL3.git git clone https://github.com/DerelictOrg/DerelictFT.git @@ -202,6 +202,35 @@ Open solution file with Mono-D dlangui-monod-osx.sln +Linux development using Mono-D +------------------------------ + +Install DUB, DMD, MonoDevelop with Mono-D plugin + +Clone DlangUI repository + + git clone https://github.com/buggins/dlangui.git + +Enter dlangui directory + + cd dlangui + +Clone dependency libraries + + mkdir deps + cd deps + git clone https://github.com/DerelictOrg/DerelictUtil.git + git clone https://github.com/DerelictOrg/DerelictGL3.git + git clone https://github.com/DerelictOrg/DerelictFT.git + git clone https://github.com/DerelictOrg/DerelictSDL2.git + git clone https://github.com/gecko0307/dlib.git + git clone https://github.com/Devisualization/image.git de_image + git clone https://github.com/Dav1dde/gl3n.git + +Open solution file with Mono-D + + dlangui-monod-linux.sln + Linux builds diff --git a/dlangui-monod-linux.dproj b/dlangui-monod-linux.dproj new file mode 100644 index 00000000..cc571b37 --- /dev/null +++ b/dlangui-monod-linux.dproj @@ -0,0 +1,189 @@ + + + + Debug + x64 + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1} + DMD2 + true + true + true + + + bin\Release + obj/Release + false + false + libdlangui-monod-linux + StaticLibrary + true + 0 + + + true + bin\Unittest + obj/Unittest + false + true + libdlangui-monod-linux + Executable + true + 0 + + + true + bin\Debug + + + USE_OPENGL + USE_SDL + USE_FREETYPE + EmbedStandardResources + + + obj/Debug + false + false + libdlangui-monod-linux + StaticLibrary + true + 0 + -Jviews +-Jviews/res +-Jviews/res/i18n +-Jviews/res/mdpi +-Jviews/res/hdpi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dlangui-monod-linux.sln b/dlangui-monod-linux.sln new file mode 100644 index 00000000..947800bd --- /dev/null +++ b/dlangui-monod-linux.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "dlangui-monod-linux", "dlangui-monod-linux.dproj", "{A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}" +EndProject +Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "example1-monod-linux", "examples\example1\example1-monod-linux.dproj", "{54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Unittest|Any CPU = Unittest|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Debug|Any CPU.ActiveCfg = Debug|x64 + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Debug|Any CPU.Build.0 = Debug|x64 + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.Build.0 = Release|Any CPU + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Unittest|Any CPU.ActiveCfg = Unittest|Any CPU + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Unittest|Any CPU.Build.0 = Unittest|Any CPU + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Debug|Any CPU.ActiveCfg = Debug|x64 + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Debug|Any CPU.Build.0 = Debug|x64 + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.Build.0 = Release|Any CPU + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Unittest|Any CPU.ActiveCfg = Unittest|Any CPU + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Unittest|Any CPU.Build.0 = Unittest|Any CPU + EndGlobalSection +EndGlobal diff --git a/examples/example1/example1-monod-linux.dproj b/examples/example1/example1-monod-linux.dproj new file mode 100644 index 00000000..d86cdc2f --- /dev/null +++ b/examples/example1/example1-monod-linux.dproj @@ -0,0 +1,78 @@ + + + + Debug + x64 + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24} + DMD2 + true + true + true + + + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1} + + + + + ../../src + ../../deps/dlib + ../../deps/gl3n + ../../deps/DerelictSDL2/source + ../../deps/DerelictFT/source + ../../deps/DerelictGL3/source + ../../deps/DerelictUtil/source + + + + + bin\Release + obj/Release + false + false + example1-monod-linux + Executable + true + 0 + + + true + bin\Unittest + obj/Unittest + false + true + example1-monod-linux + Executable + true + 0 + + + true + bin\Debug + + + USE_SDL + USE_OPENGL + USE_FREETYPE + EmbedStandardResources + + + obj/Debug + true + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + + false + example1-monod-linux + Executable + true + 0 + + + + + \ No newline at end of file diff --git a/examples/example1/src/example1.d b/examples/example1/src/example1.d index 56dec3b6..b577e4ad 100644 --- a/examples/example1/src/example1.d +++ b/examples/example1/src/example1.d @@ -239,7 +239,7 @@ extern (C) int UIAppMain(string[] args) { //} // create window - Window window = Platform.instance.createWindow("My Window", null, WindowFlag.Resizable, 600, 500); + Window window = Platform.instance.createWindow("My Window", null, WindowFlag.Resizable, 800, 700); static if (true) { VerticalLayout contentLayout = new VerticalLayout(); diff --git a/src/dlangui/core/logger.d b/src/dlangui/core/logger.d index 63220dec..8587e7a0 100644 --- a/src/dlangui/core/logger.d +++ b/src/dlangui/core/logger.d @@ -82,11 +82,13 @@ import core.sync.mutex; class Log { static __gshared private LogLevel logLevel = LogLevel.Info; static __gshared private std.stdio.File * logFile = null; - static __gshared private Mutex mutex = null; + static __gshared private Mutex _mutex = null; - static this() { - Log.mutex = new Mutex(); - } + static public @property Mutex mutex() { + if (_mutex is null) + _mutex = new Mutex(); + return _mutex; + } /// Redirects output to stdout static public void setStdoutLogger() {