Documentation for module 'NDK'

Former-commit-id: 7d8a51d8ad14bfb16a76b8d77c92c776bfb694ab [formerly 1dac8450f2eddf175b3eb2b6675621ea0b2a0df7] [formerly bb4300770d267df0eed5c509ec748c6866f36376 [formerly d15a100319ffc8805c7f93c9bcd936e204dad40b]]
Former-commit-id: 83a4715ed2a3220b7ef4718401d50ce584d275fc [formerly a941a150d510a51daed4322723795d90b6d56724]
Former-commit-id: f46308abb0bc577d73447f6a574ec091a50a9cca
This commit is contained in:
Gawaboumga
2016-08-21 13:48:52 +02:00
parent 2e29e1995f
commit c8c19f5845
75 changed files with 3374 additions and 112 deletions

View File

@@ -8,6 +8,12 @@
namespace Ndk
{
/*!
* \brief Constructs an Application object by default
*
* \remark Produces a NazaraAssert if there's more than one application instance currently running
*/
inline Application::Application() :
#ifndef NDK_SERVER
m_exitOnClosedWindows(true),
@@ -24,6 +30,10 @@ namespace Ndk
Sdk::Initialize();
}
/*!
* \brief Destructs the object
*/
inline Application::~Application()
{
m_worlds.clear();
@@ -31,13 +41,20 @@ namespace Ndk
m_windows.clear();
#endif
// Libération du SDK
// Free of SDK
Sdk::Uninitialize();
// Libération automatique des modules
// Automatic free of modules
s_application = nullptr;
}
/*!
* \brief Adds a window to the application
* \return A reference to the newly created windows
*
* \param args Arguments used to create the window
*/
#ifndef NDK_SERVER
template<typename T, typename... Args>
T& Application::AddWindow(Args&&... args)
@@ -49,6 +66,13 @@ namespace Ndk
}
#endif
/*!
* \brief Adds a world to the application
* \return A reference to the newly created world
*
* \param args Arguments used to create the world
*/
template<typename... Args>
World& Application::AddWorld(Args&&... args)
{
@@ -56,11 +80,22 @@ namespace Ndk
return m_worlds.back();
}
/*!
* \brief Gets the update time of the application
* \return Update rate
*/
inline float Application::GetUpdateTime() const
{
return m_updateTime;
}
/*!
* \brief Makes the application exit when there's no more open window
*
* \param exitOnClosedWindows Should exit be called when no more window is open
*/
#ifndef NDK_SERVER
inline void Application::MakeExitOnLastWindowClosed(bool exitOnClosedWindows)
{
@@ -68,11 +103,20 @@ namespace Ndk
}
#endif
/*!
* \brief Quits the application
*/
inline void Application::Quit()
{
m_shouldQuit = true;
}
/*!
* \brief Gets the singleton instance of the application
* \return Singleton application
*/
inline Application* Application::Instance()
{
return s_application;