Преглед изворни кода

Chosen CMake modules during build will now automatically be used for engine initialization

BearishSun пре 9 година
родитељ
комит
671b4756e3

+ 2 - 1
.gitignore

@@ -11,4 +11,5 @@ Builds
 Documentation/html
 Documentation/html
 Build
 Build
 *.aps
 *.aps
-*.opendb
+*.opendb
+BsEngineConfig.h

+ 8 - 19
Source/BansheeEditor/Include/BsEditorApplication.h

@@ -11,22 +11,15 @@ namespace BansheeEngine
 	 *  @{
 	 *  @{
 	 */
 	 */
 
 
-	/**	Types of render APIs supported by the editor. */
-	enum class EditorRenderAPI
-	{
-		DX11,
-		OpenGL
-	};
-
 	/**	Primary editor class containing the editor entry point. */
 	/**	Primary editor class containing the editor entry point. */
 	class BS_ED_EXPORT EditorApplication : public Application
 	class BS_ED_EXPORT EditorApplication : public Application
 	{
 	{
 	public:
 	public:
-		EditorApplication(EditorRenderAPI renderAPI, AudioPlugin audio);
+		EditorApplication();
 		virtual ~EditorApplication();
 		virtual ~EditorApplication();
 
 
 		/**	Starts the editor with the specified render and audio systems. */
 		/**	Starts the editor with the specified render and audio systems. */
-		static void startUp(EditorRenderAPI renderAPI, AudioPlugin audio);
+		static void startUp();
 
 
 		/**	Checks whether the editor currently has a project loaded. */
 		/**	Checks whether the editor currently has a project loaded. */
 		bool isProjectLoaded() const { return mIsProjectLoaded; }
 		bool isProjectLoaded() const { return mIsProjectLoaded; }
@@ -90,19 +83,19 @@ namespace BansheeEngine
 		bool isEditor() const override { return true; }
 		bool isEditor() const override { return true; }
 	private:
 	private:
 		/** @copydoc Module::onStartUp */
 		/** @copydoc Module::onStartUp */
-		virtual void onStartUp() override;
+		void onStartUp() override;
 
 
 		/** @copydoc Module::onShutDown */
 		/** @copydoc Module::onShutDown */
-		virtual void onShutDown() override;
+		void onShutDown() override;
 
 
 		/** @copydoc CoreApplication::preUpdate */
 		/** @copydoc CoreApplication::preUpdate */
-		virtual void preUpdate() override;
+		void preUpdate() override;
 
 
 		/** @copydoc CoreApplication::postUpdate */
 		/** @copydoc CoreApplication::postUpdate */
-		virtual void postUpdate() override;
+		void postUpdate() override;
 
 
 		/** @copydoc CoreApplication::quitRequested */
 		/** @copydoc CoreApplication::quitRequested */
-		virtual void quitRequested() override;
+		void quitRequested() override;
 
 
 		/** @copydoc Application::loadScriptSystem */
 		/** @copydoc Application::loadScriptSystem */
 		void loadScriptSystem() override;
 		void loadScriptSystem() override;
@@ -129,17 +122,13 @@ namespace BansheeEngine
 		void loadProjectSettings();
 		void loadProjectSettings();
 
 
 		/** @copydoc Application::getShaderIncludeHandler */
 		/** @copydoc Application::getShaderIncludeHandler */
-		virtual SPtr<IShaderIncludeHandler> getShaderIncludeHandler() const override;
-
-		/** Converts a render API type supported by the editor into a type recognized by the lower layers of the engine. */
-		static RenderAPIPlugin toEngineRenderAPI(EditorRenderAPI renderAPI);
+		SPtr<IShaderIncludeHandler> getShaderIncludeHandler() const override;
 
 
 	private:
 	private:
 		static const Path WIDGET_LAYOUT_PATH;
 		static const Path WIDGET_LAYOUT_PATH;
 		static const Path BUILD_DATA_PATH;
 		static const Path BUILD_DATA_PATH;
 		static const Path PROJECT_SETTINGS_PATH;
 		static const Path PROJECT_SETTINGS_PATH;
 
 
-		RenderAPIPlugin mActiveRAPIPlugin;
 		SPtr<EditorSettings> mEditorSettings;
 		SPtr<EditorSettings> mEditorSettings;
 		SPtr<ProjectSettings> mProjectSettings;
 		SPtr<ProjectSettings> mProjectSettings;
 
 

+ 25 - 38
Source/BansheeEditor/Source/BsEditorApplication.cpp

@@ -36,29 +36,28 @@ namespace BansheeEngine
 	const Path EditorApplication::BUILD_DATA_PATH = PROJECT_INTERNAL_DIR + L"BuildData.asset";
 	const Path EditorApplication::BUILD_DATA_PATH = PROJECT_INTERNAL_DIR + L"BuildData.asset";
 	const Path EditorApplication::PROJECT_SETTINGS_PATH = PROJECT_INTERNAL_DIR + L"Settings.asset";
 	const Path EditorApplication::PROJECT_SETTINGS_PATH = PROJECT_INTERNAL_DIR + L"Settings.asset";
 
 
-	RENDER_WINDOW_DESC createRenderWindowDesc()
+	START_UP_DESC createStartupDesc()
 	{
 	{
-		RENDER_WINDOW_DESC renderWindowDesc;
-		renderWindowDesc.videoMode = VideoMode(1920, 1080);
-		renderWindowDesc.title = "BansheeEditor";
-		renderWindowDesc.fullscreen = false;
-		renderWindowDesc.border = WindowBorder::None;
-		renderWindowDesc.hideUntilSwap = true;
-		renderWindowDesc.depthBuffer = false;
-
-		return renderWindowDesc;
-	}
-
-	Vector<String> getImporters()
-	{
-		Vector<String> importers;
-
-		importers.push_back("BansheeFreeImgImporter");
-		importers.push_back("BansheeFBXImporter");
-		importers.push_back("BansheeFontImporter");
-		importers.push_back("BansheeSL");
-
-		return importers;
+		START_UP_DESC startUpDesc;
+		startUpDesc.renderAPI = BS_RENDER_API_MODULE;
+		startUpDesc.renderer = BS_RENDERER_MODULE;
+		startUpDesc.audio = BS_AUDIO_MODULE;
+		startUpDesc.physics = BS_PHYSICS_MODULE;
+		startUpDesc.input = BS_INPUT_MODULE;
+
+		startUpDesc.primaryWindowDesc.videoMode = VideoMode(1920, 1080);
+		startUpDesc.primaryWindowDesc.title = "BansheeEditor";
+		startUpDesc.primaryWindowDesc.fullscreen = false;
+		startUpDesc.primaryWindowDesc.border = WindowBorder::None;
+		startUpDesc.primaryWindowDesc.hideUntilSwap = true;
+		startUpDesc.primaryWindowDesc.depthBuffer = false;
+
+		startUpDesc.importers.push_back("BansheeFreeImgImporter");
+		startUpDesc.importers.push_back("BansheeFBXImporter");
+		startUpDesc.importers.push_back("BansheeFontImporter");
+		startUpDesc.importers.push_back("BansheeSL");
+
+		return startUpDesc;
 	}
 	}
 
 
 	Path getEditorSettingsPath()
 	Path getEditorSettingsPath()
@@ -66,9 +65,8 @@ namespace BansheeEngine
 		return Paths::getRuntimeDataPath() + L"Settings.asset";
 		return Paths::getRuntimeDataPath() + L"Settings.asset";
 	}
 	}
 
 
-	EditorApplication::EditorApplication(EditorRenderAPI renderAPIPlugin, AudioPlugin audio)
-		:Application(createRenderWindowDesc(), toEngineRenderAPI(renderAPIPlugin), RendererPlugin::Default, audio, getImporters()),
-		mActiveRAPIPlugin(toEngineRenderAPI(renderAPIPlugin)), mIsProjectLoaded(false), mSBansheeEditorPlugin(nullptr)
+	EditorApplication::EditorApplication()
+		:Application(createStartupDesc()), mIsProjectLoaded(false), mSBansheeEditorPlugin(nullptr)
 	{
 	{
 
 
 	}
 	}
@@ -147,9 +145,9 @@ namespace BansheeEngine
 		loadPlugin("SBansheeEditor", &mSBansheeEditorPlugin);
 		loadPlugin("SBansheeEditor", &mSBansheeEditorPlugin);
 	}
 	}
 
 
-	void EditorApplication::startUp(EditorRenderAPI renderAPI, AudioPlugin audio)
+	void EditorApplication::startUp()
 	{
 	{
-		CoreApplication::startUp<EditorApplication>(renderAPI, audio);
+		CoreApplication::startUp<EditorApplication>();
 	}
 	}
 
 
 	void EditorApplication::preUpdate()
 	void EditorApplication::preUpdate()
@@ -404,17 +402,6 @@ namespace BansheeEngine
 		return bs_shared_ptr_new<EditorShaderIncludeHandler>();
 		return bs_shared_ptr_new<EditorShaderIncludeHandler>();
 	}
 	}
 
 
-	RenderAPIPlugin EditorApplication::toEngineRenderAPI(EditorRenderAPI renderAPI)
-	{
-		if (renderAPI == EditorRenderAPI::DX11)
-			return RenderAPIPlugin::DX11;
-		else if (renderAPI == EditorRenderAPI::OpenGL)
-			return RenderAPIPlugin::OpenGL;
-
-		BS_EXCEPT(InvalidStateException, "Unsupported render API.");
-		return RenderAPIPlugin::DX11;
-	}
-
 	EditorApplication& gEditorApplication()
 	EditorApplication& gEditorApplication()
 	{
 	{
 		return static_cast<EditorApplication&>(EditorApplication::instance());
 		return static_cast<EditorApplication&>(EditorApplication::instance());

+ 1 - 1
Source/BansheeEditorExec/BsEditorExec.cpp

@@ -64,7 +64,7 @@ int CALLBACK WinMain(
 
 
 	__try
 	__try
 	{
 	{
-		EditorApplication::startUp(EditorRenderAPI::DX11, AudioPlugin::OpenAudio);
+		EditorApplication::startUp();
 		EditorApplication::instance().runMainLoop();
 		EditorApplication::instance().runMainLoop();
 		EditorApplication::shutDown();
 		EditorApplication::shutDown();
 	}
 	}

+ 9 - 49
Source/BansheeEngine/Include/BsApplication.h

@@ -4,6 +4,7 @@
 
 
 #include "BsPrerequisites.h"
 #include "BsPrerequisites.h"
 #include "BsCoreApplication.h"
 #include "BsCoreApplication.h"
+#include "BsEngineConfig.h"
 #include "BsEvent.h"
 #include "BsEvent.h"
 
 
 namespace BansheeEngine
 namespace BansheeEngine
@@ -12,47 +13,15 @@ namespace BansheeEngine
 	 *  @{
 	 *  @{
 	 */
 	 */
 
 
-	/**	Types of available render systems. */
-	enum class RenderAPIPlugin
-	{
-		DX11,
-		DX9,
-		OpenGL
-	};
-
-	/**	Types of available renderers. */
-	enum class RendererPlugin
-	{
-		Default
-	};
-
-	/**	Types of available audio systems. */
-	enum class AudioPlugin
-	{
-		OpenAudio, /**< Open-source audio implementation using OpenAL. */
-		FMOD /**< Audio system implementation using FMOD. */
-	};
-
 	/**	Primary entry point for Banshee engine. Handles startup and shutdown. */
 	/**	Primary entry point for Banshee engine. Handles startup and shutdown. */
 	class BS_EXPORT Application : public CoreApplication
 	class BS_EXPORT Application : public CoreApplication
 	{
 	{
 	public:
 	public:
-		Application(RENDER_WINDOW_DESC primaryWindowDesc, RenderAPIPlugin renderAPI, RendererPlugin renderer, 
-			AudioPlugin audio, const Vector<String>& importers);
+		Application(const START_UP_DESC& desc);
 		virtual ~Application();
 		virtual ~Application();
 
 
-		/**
-		 * Starts the Banshee engine.
-		 * 
-		 * @param[in]	primaryWindowDesc	Description of the primary render window that will be created on startup.
-		 * @param[in]	renderAPI			Render API plugin to use.
-		 * @param[in]	renderer			Renderer plugin to use.
-		 * @param[in]	audio				Audio plugin to use.
-		 * @param[in]	importers			A list of importer plugins to load on startup.
-		 */
-		static void startUp(RENDER_WINDOW_DESC& primaryWindowDesc, RenderAPIPlugin renderAPI, 
-			RendererPlugin renderer = RendererPlugin::Default, AudioPlugin audio = AudioPlugin::OpenAudio, 
-			const Vector<String>& importers = Vector<String>());
+		/** Starts the Banshee engine. */
+		static void startUp(const START_UP_DESC& desc);
 
 
 		/**	Returns the absolute path to the builtin managed engine assembly file. */
 		/**	Returns the absolute path to the builtin managed engine assembly file. */
 		Path getEngineAssemblyPath() const;
 		Path getEngineAssemblyPath() const;
@@ -65,19 +34,19 @@ namespace BansheeEngine
 
 
 	protected:
 	protected:
 		/** @copydoc Module::onStartUp */
 		/** @copydoc Module::onStartUp */
-		virtual void onStartUp() override;
+		void onStartUp() override;
 
 
 		/** @copydoc Module::onShutDown */
 		/** @copydoc Module::onShutDown */
-		virtual void onShutDown() override;
+		void onShutDown() override;
 
 
 		/** @copydoc CoreApplication::preUpdate */
 		/** @copydoc CoreApplication::preUpdate */
-		virtual void preUpdate() override;
+		void preUpdate() override;
 
 
 		/** @copydoc CoreApplication::postUpdate */
 		/** @copydoc CoreApplication::postUpdate */
-		virtual void postUpdate() override;
+		void postUpdate() override;
 
 
 		/** @copydoc CoreApplication::startUpRenderer */
 		/** @copydoc CoreApplication::startUpRenderer */
-		virtual void startUpRenderer() override;
+		void startUpRenderer() override;
 
 
 		/** @copydoc CoreApplication::getShaderIncludeHandler */
 		/** @copydoc CoreApplication::getShaderIncludeHandler */
 		SPtr<IShaderIncludeHandler> getShaderIncludeHandler() const override;
 		SPtr<IShaderIncludeHandler> getShaderIncludeHandler() const override;
@@ -91,15 +60,6 @@ namespace BansheeEngine
 		/**	Returns the absolute path to the folder where built-in assemblies are located in. */
 		/**	Returns the absolute path to the folder where built-in assemblies are located in. */
 		virtual Path getBuiltinAssemblyFolder() const;
 		virtual Path getBuiltinAssemblyFolder() const;
 
 
-		/**	Translates render system type into library name. */
-		static String getLibNameForRenderAPI(RenderAPIPlugin plugin);
-
-		/**	Translates renderer type into library name. */
-		static String getLibNameForRenderer(RendererPlugin plugin);
-
-		/**	Translates audio system type into library name. */
-		static String getLibNameForAudio(AudioPlugin plugin);
-
 		DynLib* mMonoPlugin;
 		DynLib* mMonoPlugin;
 		DynLib* mSBansheeEnginePlugin;
 		DynLib* mSBansheeEnginePlugin;
 	};
 	};

+ 4 - 72
Source/BansheeEngine/Source/BsApplication.cpp

@@ -22,27 +22,8 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	START_UP_DESC createStartUpDesc(RENDER_WINDOW_DESC& primaryWindowDesc, const String& renderAPI, const String& renderer, 
-		const String& audio, const Vector<String>& importers)
-	{
-		START_UP_DESC desc;
-		desc.renderAPI = renderAPI;
-		desc.renderer = renderer;
-		desc.audio = audio;
-		desc.physics = "BansheePhysX";
-		desc.input = "BansheeOISInput";
-
-		desc.primaryWindowDesc = primaryWindowDesc;
-		desc.importers = importers;
-
-		return desc;
-	}
-
-	Application::Application(RENDER_WINDOW_DESC primaryWindowDesc, RenderAPIPlugin renderAPI, RendererPlugin renderer, 
-		AudioPlugin audio, const Vector<String>& importers)
-		: CoreApplication(createStartUpDesc(primaryWindowDesc, getLibNameForRenderAPI(renderAPI)
-		, getLibNameForRenderer(renderer), getLibNameForAudio(audio), importers)), mMonoPlugin(nullptr)
-		, mSBansheeEnginePlugin(nullptr)
+	Application::Application(const START_UP_DESC& desc)
+		: CoreApplication(desc), mMonoPlugin(nullptr), mSBansheeEnginePlugin(nullptr)
 	{
 	{
 
 
 	}
 	}
@@ -99,10 +80,9 @@ namespace BansheeEngine
 		CoreApplication::onShutDown();
 		CoreApplication::onShutDown();
 	}
 	}
 
 
-	void Application::startUp(RENDER_WINDOW_DESC& primaryWindowDesc, RenderAPIPlugin renderAPI, 
-		RendererPlugin renderer, AudioPlugin audio, const Vector<String>& importers)
+	void Application::startUp(const START_UP_DESC& desc)
 	{
 	{
-		CoreApplication::startUp<Application>(primaryWindowDesc, renderAPI, renderer, audio, importers);
+		CoreApplication::startUp<Application>(desc);
 	}
 	}
 
 
 	void Application::preUpdate()
 	void Application::preUpdate()
@@ -188,54 +168,6 @@ namespace BansheeEngine
 		return bs_shared_ptr_new<EngineShaderIncludeHandler>();
 		return bs_shared_ptr_new<EngineShaderIncludeHandler>();
 	}
 	}
 
 
-	String Application::getLibNameForRenderAPI(RenderAPIPlugin plugin)
-	{
-		static String DX11Name = "BansheeD3D11RenderAPI";
-		static String DX9Name = "BansheeD3D9RenderAPI";
-		static String OpenGLName = "BansheeGLRenderAPI";
-
-		switch (plugin)
-		{
-		case RenderAPIPlugin::DX11:
-			return DX11Name;
-		case RenderAPIPlugin::DX9:
-			return DX9Name;
-		case RenderAPIPlugin::OpenGL:
-			return OpenGLName;
-		}
-
-		return StringUtil::BLANK;
-	}
-
-	String Application::getLibNameForRenderer(RendererPlugin plugin)
-	{
-		static String DefaultName = "RenderBeast";
-
-		switch (plugin)
-		{
-		case RendererPlugin::Default:
-			return DefaultName;
-		}
-	
-		return StringUtil::BLANK;
-	}
-
-	String Application::getLibNameForAudio(AudioPlugin plugin)
-	{
-		static String OpenAudioName = "BansheeOpenAudio";
-		static String FMODName = "BansheeFMOD";
-
-		switch (plugin)
-		{
-		case AudioPlugin::OpenAudio:
-			return OpenAudioName;
-		case AudioPlugin::FMOD:
-			return FMODName;
-		}
-
-		return StringUtil::BLANK;
-	}
-
 	Application& gApplication()
 	Application& gApplication()
 	{
 	{
 		return static_cast<Application&>(Application::instance());
 		return static_cast<Application&>(Application::instance());

+ 8 - 0
Source/CMake/BsEngineConfig.h.in

@@ -0,0 +1,8 @@
+#define BS_VERSION_MAJOR @BS_VERSION_MAJOR@
+#define BS_VERSION_MINOR @BS_VERSION_MINOR@
+
+#define BS_RENDERER_MODULE "@RENDERER_MODULE_LIB@"
+#define BS_RENDER_API_MODULE "@RENDER_API_MODULE_LIB@"
+#define BS_AUDIO_MODULE "@AUDIO_MODULE_LIB@"
+#define BS_PHYSICS_MODULE "@PHYSICS_MODULE_LIB@"
+#define BS_INPUT_MODULE "@INPUT_MODULE_LIB@"

+ 25 - 8
Source/CMakeLists.txt

@@ -2,8 +2,8 @@ cmake_minimum_required (VERSION 3.5.1)
 project (Banshee)
 project (Banshee)
 
 
 # Version
 # Version
-set (Banshee_VERSION_MAJOR 0)
-set (Banshee_VERSION_MINOR 3)
+set (BS_VERSION_MAJOR 0)
+set (BS_VERSION_MINOR 3)
 
 
 # Configuration types
 # Configuration types
 if(CMAKE_CONFIGURATION_TYPES) # Multiconfig generator?
 if(CMAKE_CONFIGURATION_TYPES) # Multiconfig generator?
@@ -47,6 +47,9 @@ set(BUILD_EDITOR ON CACHE BOOL "If true both the engine and the editor will be b
 
 
 mark_as_advanced(CMAKE_INSTALL_PREFIX)
 mark_as_advanced(CMAKE_INSTALL_PREFIX)
 
 
+# External code
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/Modules/")
+
 # Global compile & linker flags
 # Global compile & linker flags
 ## Compiler-agnostic settings
 ## Compiler-agnostic settings
 ### Target at least C++11
 ### Target at least C++11
@@ -188,27 +191,38 @@ add_subdirectory(BansheeEngine)
 
 
 if(RENDER_API_MODULE MATCHES "DirectX 11")
 if(RENDER_API_MODULE MATCHES "DirectX 11")
 	add_subdirectory(BansheeD3D11RenderAPI)
 	add_subdirectory(BansheeD3D11RenderAPI)
+	set(RENDER_API_MODULE_LIB BansheeD3D11RenderAPI)
 elseif(RENDER_API_MODULE MATCHES "DirectX 9")
 elseif(RENDER_API_MODULE MATCHES "DirectX 9")
 	add_subdirectory(BansheeD3D9RenderAPI)
 	add_subdirectory(BansheeD3D9RenderAPI)
+	set(RENDER_API_MODULE_LIB BansheeD3D9RenderAPI)
 else()
 else()
 	add_subdirectory(BansheeGLRenderAPI)
 	add_subdirectory(BansheeGLRenderAPI)
+	set(RENDER_API_MODULE_LIB BansheeGLRenderAPI)
 endif()
 endif()
 
 
-add_subdirectory(BansheeFBXImporter)
-add_subdirectory(BansheeFontImporter)
-add_subdirectory(BansheeFreeImgImporter)
-add_subdirectory(BansheeMono)
+add_subdirectory(RenderBeast)
+set(RENDERER_MODULE_LIB RenderBeast)
+
 add_subdirectory(BansheeOISInput)
 add_subdirectory(BansheeOISInput)
+set(INPUT_MODULE_LIB BansheeOISInput)
+
 add_subdirectory(BansheePhysX)
 add_subdirectory(BansheePhysX)
-add_subdirectory(BansheeSL)
-add_subdirectory(RenderBeast)
+set(PHYSICS_MODULE_LIB BansheePhysX)
 
 
 if(AUDIO_MODULE MATCHES "FMOD")
 if(AUDIO_MODULE MATCHES "FMOD")
 	add_subdirectory(BansheeFMOD)
 	add_subdirectory(BansheeFMOD)
+	set(AUDIO_MODULE_LIB BansheeFMOD)
 else() # Default to OpenAudio
 else() # Default to OpenAudio
 	add_subdirectory(BansheeOpenAudio)
 	add_subdirectory(BansheeOpenAudio)
+	set(AUDIO_MODULE_LIB BansheeOpenAudio)
 endif()
 endif()
 
 
+add_subdirectory(BansheeFBXImporter)
+add_subdirectory(BansheeFontImporter)
+add_subdirectory(BansheeFreeImgImporter)
+add_subdirectory(BansheeMono)
+add_subdirectory(BansheeSL)
+
 ## Script interop
 ## Script interop
 add_subdirectory(SBansheeEngine)
 add_subdirectory(SBansheeEngine)
 
 
@@ -239,3 +253,6 @@ if(MSVC)
 else()
 else()
 # TODO - Use Mono compiler to build the managed code as a pre-build step
 # TODO - Use Mono compiler to build the managed code as a pre-build step
 endif()
 endif()
+
+# Config file
+configure_file("${PROJECT_SOURCE_DIR}/CMake/BsEngineConfig.h.in" "${PROJECT_SOURCE_DIR}/BansheeEngine/Include/BsEngineConfig.h")

+ 21 - 16
Source/ExampleProject/Source/Main.cpp

@@ -78,25 +78,30 @@ int CALLBACK WinMain(
 	_In_  int nCmdShow
 	_In_  int nCmdShow
 	)
 	)
 {
 {
+	// Descriptor used for initializing the engine
+	START_UP_DESC startUpDesc;
+
+	// Use default values as specified by the build system
+	startUpDesc.renderAPI = BS_RENDER_API_MODULE;
+	startUpDesc.renderer = BS_RENDERER_MODULE;
+	startUpDesc.audio = BS_AUDIO_MODULE;
+	startUpDesc.physics = BS_PHYSICS_MODULE;
+	startUpDesc.input = BS_INPUT_MODULE;
+
 	// Descriptor used for initializing the primary application window.
 	// Descriptor used for initializing the primary application window.
-	RENDER_WINDOW_DESC renderWindowDesc;
-	renderWindowDesc.videoMode = VideoMode(windowResWidth, windowResHeight);
-	renderWindowDesc.title = "Banshee Example App";
-	renderWindowDesc.fullscreen = false;
-	renderWindowDesc.depthBuffer = false;
+	startUpDesc.primaryWindowDesc.videoMode = VideoMode(windowResWidth, windowResHeight);
+	startUpDesc.primaryWindowDesc.title = "Banshee Example App";
+	startUpDesc.primaryWindowDesc.fullscreen = false;
+	startUpDesc.primaryWindowDesc.depthBuffer = false;
 
 
 	// List of importer plugins we plan on using for importing various resources
 	// List of importer plugins we plan on using for importing various resources
-	Vector<String> importers;
-	importers.push_back("BansheeFreeImgImporter"); // For importing textures
-	importers.push_back("BansheeFBXImporter"); // For importing meshes
-	importers.push_back("BansheeFontImporter"); // For importing fonts
-	importers.push_back("BansheeSL"); // For importing shaders
-
-	// Initializes the application with primary window defined as above and DirectX 11 render system.
-	// You may use other render systems than DirectX 11, however this example for simplicity only uses DirectX 11.
-	// If you wanted other render systems you would need to create separate shaders for them and import them
-	// along with (or replace) the DX11 ones.
-	Application::startUp(renderWindowDesc, RenderAPIPlugin::DX11, RendererPlugin::Default, importers);
+	startUpDesc.importers.push_back("BansheeFreeImgImporter"); // For importing textures
+	startUpDesc.importers.push_back("BansheeFBXImporter"); // For importing meshes
+	startUpDesc.importers.push_back("BansheeFontImporter"); // For importing fonts
+	startUpDesc.importers.push_back("BansheeSL"); // For importing shaders
+
+	// Initializes the application with systems and primary window as defined above
+	Application::startUp(startUpDesc);
 
 
 	// Imports all of ours assets and prepares GameObjects that handle the example logic.
 	// Imports all of ours assets and prepares GameObjects that handle the example logic.
 	setUpExample();
 	setUpExample();

+ 14 - 8
Source/Game/Source/Main.cpp

@@ -66,14 +66,20 @@ void runApplication()
 		resolutionHeight = gameSettings->resolutionHeight;
 		resolutionHeight = gameSettings->resolutionHeight;
 	}
 	}
 
 
-	RENDER_WINDOW_DESC renderWindowDesc;
-	renderWindowDesc.videoMode = VideoMode(resolutionWidth, resolutionHeight);
-	renderWindowDesc.title = toString(gameSettings->titleBarText);
-	renderWindowDesc.fullscreen = false;
-	renderWindowDesc.hidden = gameSettings->fullscreen;
-	renderWindowDesc.depthBuffer = false;
-
-	Application::startUp(renderWindowDesc, RenderAPIPlugin::DX11);
+	START_UP_DESC startUpDesc;
+	startUpDesc.renderAPI = BS_RENDER_API_MODULE;
+	startUpDesc.renderer = BS_RENDERER_MODULE;
+	startUpDesc.audio = BS_AUDIO_MODULE;
+	startUpDesc.physics = BS_PHYSICS_MODULE;
+	startUpDesc.input = BS_INPUT_MODULE;
+
+	startUpDesc.primaryWindowDesc.videoMode = VideoMode(resolutionWidth, resolutionHeight);
+	startUpDesc.primaryWindowDesc.title = toString(gameSettings->titleBarText);
+	startUpDesc.primaryWindowDesc.fullscreen = false;
+	startUpDesc.primaryWindowDesc.hidden = gameSettings->fullscreen;
+	startUpDesc.primaryWindowDesc.depthBuffer = false;
+
+	Application::startUp(startUpDesc);
 
 
 	// Note: What if script tries to load resources during startup? The manifest nor the mapping wont be set up yet.
 	// Note: What if script tries to load resources during startup? The manifest nor the mapping wont be set up yet.
 	Path resourcesPath = Paths::getGameResourcesPath();
 	Path resourcesPath = Paths::getGameResourcesPath();