Documentation for module 'NDK'

Former-commit-id: 63e1cac538c577a1f1aafa71fa7eef69a6d4daab [formerly b2d8769fd02a0e7d9c476d4ad7be1988a1fd6789] [formerly 636b5cb79bcb8da44d9aa45ba1023565bcf29f0d [formerly a2361ec2b8679d4d4ba096e543b5d4b91825dd62]]
Former-commit-id: d402d35477f9db0135c553d55c401939426bf62d [formerly 607336ea0f42731e4604f3a8c2df06f3aecfc401]
Former-commit-id: 69e23cd6c06723486de5e4641ce810012dac66da
This commit is contained in:
Gawaboumga
2016-08-21 13:48:52 +02:00
parent 42abd200be
commit 9eba331f34
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;