|
@@ -7,26 +7,29 @@
|
|
|
|
|
|
|
|
namespace BansheeEngine
|
|
namespace BansheeEngine
|
|
|
{
|
|
{
|
|
|
- class RenderWindow;
|
|
|
|
|
- class Viewport;
|
|
|
|
|
- class GpuProgramManager;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-namespace BansheeEngine
|
|
|
|
|
-{
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Structure containing parameters for starting the application.
|
|
|
|
|
+ */
|
|
|
struct START_UP_DESC
|
|
struct START_UP_DESC
|
|
|
{
|
|
{
|
|
|
- String renderSystem;
|
|
|
|
|
- String renderer;
|
|
|
|
|
|
|
+ String renderSystem; /**< Name of the render system plugin to use. */
|
|
|
|
|
+ String renderer; /**< Name of the renderer plugin to use. */
|
|
|
|
|
|
|
|
- String input;
|
|
|
|
|
- String sceneManager;
|
|
|
|
|
|
|
+ String input; /**< Name of the input plugin to use. */
|
|
|
|
|
+ String sceneManager; /**< Name of the scene manager plugin to use. */
|
|
|
|
|
|
|
|
- RENDER_WINDOW_DESC primaryWindowDesc;
|
|
|
|
|
|
|
+ RENDER_WINDOW_DESC primaryWindowDesc; /**< Describes the window to create during start-up. */
|
|
|
|
|
|
|
|
- Vector<String> importers;
|
|
|
|
|
|
|
+ Vector<String> importers; /**< A list of importer plugins to load. */
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Represents the primary entry point to the engine. Handles
|
|
|
|
|
+ * start-up, shutdown, primary loop and allows you to load and unload
|
|
|
|
|
+ * plugins.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @note Sim thread only.
|
|
|
|
|
+ */
|
|
|
class CM_EXPORT Application
|
|
class CM_EXPORT Application
|
|
|
{
|
|
{
|
|
|
public:
|
|
public:
|
|
@@ -34,13 +37,13 @@ namespace BansheeEngine
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Starts the application using the specified options.
|
|
* @brief Starts the application using the specified options.
|
|
|
- * This is how you start the engine.
|
|
|
|
|
|
|
+ * This is how you start the engine. Must be called before any other engine method.
|
|
|
*/
|
|
*/
|
|
|
void startUp(START_UP_DESC& desc);
|
|
void startUp(START_UP_DESC& desc);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @brief Executes the main loop. This will cause actually rendering to be performed
|
|
|
|
|
- * and simulation to be run. Usually called immediately after startUp().
|
|
|
|
|
|
|
+ * @brief Executes the main loop. This will update your components and modules, queue objects
|
|
|
|
|
+ * for rendering and run the simulation. Usually called immediately after startUp().
|
|
|
*
|
|
*
|
|
|
* This will run infinitely until stopMainLoop is called (usually from another thread or internally).
|
|
* This will run infinitely until stopMainLoop is called (usually from another thread or internally).
|
|
|
*/
|
|
*/
|
|
@@ -48,7 +51,6 @@ namespace BansheeEngine
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Stops a (infinite) main loop from running. The loop will complete its current cycle before stopping.
|
|
* @brief Stops a (infinite) main loop from running. The loop will complete its current cycle before stopping.
|
|
|
- * You may call this from other threads.
|
|
|
|
|
*/
|
|
*/
|
|
|
void stopMainLoop();
|
|
void stopMainLoop();
|
|
|
|
|
|
|
@@ -57,19 +59,27 @@ namespace BansheeEngine
|
|
|
*/
|
|
*/
|
|
|
void shutDown();
|
|
void shutDown();
|
|
|
|
|
|
|
|
|
|
+ // DEPRECATED
|
|
|
UINT64 getAppWindowId();
|
|
UINT64 getAppWindowId();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief
|
|
|
|
|
+ */
|
|
|
RenderWindowPtr getPrimaryWindow() const { return mPrimaryWindow; }
|
|
RenderWindowPtr getPrimaryWindow() const { return mPrimaryWindow; }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Loads a plugin.
|
|
* @brief Loads a plugin.
|
|
|
*
|
|
*
|
|
|
- * @param pluginName Name of the plugin to load, without extension.
|
|
|
|
|
|
|
+ * @param pluginName Name of the plugin to load, without extension.
|
|
|
|
|
+ * @param [out] library Specify as not null to receive a reference to
|
|
|
|
|
+ * the loaded library.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @returns Value returned from the plugin start-up method.
|
|
|
*/
|
|
*/
|
|
|
void* loadPlugin(const String& pluginName, DynLib** library = nullptr);
|
|
void* loadPlugin(const String& pluginName, DynLib** library = nullptr);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @brief Unloads a plugin.
|
|
|
|
|
|
|
+ * @brief Unloads a previously loaded plugin.
|
|
|
*/
|
|
*/
|
|
|
void unloadPlugin(DynLib* library);
|
|
void unloadPlugin(DynLib* library);
|
|
|
|
|
|
|
@@ -79,16 +89,6 @@ namespace BansheeEngine
|
|
|
Event<void()> mainLoopCallback;
|
|
Event<void()> mainLoopCallback;
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
|
- RenderWindowPtr mPrimaryWindow;
|
|
|
|
|
-
|
|
|
|
|
- DynLib* mSceneManagerPlugin;
|
|
|
|
|
-
|
|
|
|
|
- bool mIsFrameRenderingFinished;
|
|
|
|
|
- CM_MUTEX(mFrameRenderingFinishedMutex);
|
|
|
|
|
- CM_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
|
|
|
|
|
-
|
|
|
|
|
- volatile bool mRunMainLoop;
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Called when the frame finishes rendering.
|
|
* @brief Called when the frame finishes rendering.
|
|
|
*/
|
|
*/
|
|
@@ -103,7 +103,21 @@ namespace BansheeEngine
|
|
|
* @brief Called by the core thread to end profiling.
|
|
* @brief Called by the core thread to end profiling.
|
|
|
*/
|
|
*/
|
|
|
void endCoreProfiling();
|
|
void endCoreProfiling();
|
|
|
|
|
+
|
|
|
|
|
+ private:
|
|
|
|
|
+ RenderWindowPtr mPrimaryWindow;
|
|
|
|
|
+
|
|
|
|
|
+ DynLib* mSceneManagerPlugin;
|
|
|
|
|
+
|
|
|
|
|
+ bool mIsFrameRenderingFinished;
|
|
|
|
|
+ CM_MUTEX(mFrameRenderingFinishedMutex);
|
|
|
|
|
+ CM_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
|
|
|
|
|
+
|
|
|
|
|
+ volatile bool mRunMainLoop;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Provides easy access to primary entry point for the engine.
|
|
|
|
|
+ */
|
|
|
CM_EXPORT Application& gApplication();
|
|
CM_EXPORT Application& gApplication();
|
|
|
}
|
|
}
|