[deploy] Add GetVersion function
This commit is contained in:
parent
a1e7e77c96
commit
a6961c0d20
|
|
@ -0,0 +1,5 @@
|
||||||
|
// 提示文件帮助 Visual Studio IDE 解释 Visual C++ 标识符,
|
||||||
|
// 如函数和宏的名称。
|
||||||
|
// 有关详细信息,请参见 https://go.microsoft.com/fwlink/?linkid=865984
|
||||||
|
|
||||||
|
#define KGE_API
|
||||||
|
|
@ -182,6 +182,9 @@
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="cpp.hint" />
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}</ProjectGuid>
|
<ProjectGuid>{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}</ProjectGuid>
|
||||||
<RootNamespace>kiwano</RootNamespace>
|
<RootNamespace>kiwano</RootNamespace>
|
||||||
|
|
|
||||||
|
|
@ -534,4 +534,7 @@
|
||||||
<Filter>core</Filter>
|
<Filter>core</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="cpp.hint" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -29,6 +29,11 @@
|
||||||
namespace kiwano
|
namespace kiwano
|
||||||
{
|
{
|
||||||
|
|
||||||
|
int GetVersion()
|
||||||
|
{
|
||||||
|
return KGE_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
Application::Application()
|
Application::Application()
|
||||||
: quiting_(false)
|
: quiting_(false)
|
||||||
, time_scale_(1.f)
|
, time_scale_(1.f)
|
||||||
|
|
@ -40,11 +45,6 @@ Application::Application()
|
||||||
|
|
||||||
Application::~Application() {}
|
Application::~Application() {}
|
||||||
|
|
||||||
int Application::GetVersion() const
|
|
||||||
{
|
|
||||||
return KGE_VERSION;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::Run(RunnerPtr runner, bool debug)
|
void Application::Run(RunnerPtr runner, bool debug)
|
||||||
{
|
{
|
||||||
KGE_ASSERT(runner);
|
KGE_ASSERT(runner);
|
||||||
|
|
@ -112,6 +112,22 @@ void Application::SetTimeScale(float scale_factor)
|
||||||
time_scale_ = scale_factor;
|
time_scale_ = scale_factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::DispatchEvent(EventPtr evt)
|
||||||
|
{
|
||||||
|
this->DispatchEvent(evt.Get());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Application::DispatchEvent(Event* evt)
|
||||||
|
{
|
||||||
|
for (auto comp : modules_)
|
||||||
|
{
|
||||||
|
if (auto event_comp = comp->Cast<EventModule>())
|
||||||
|
{
|
||||||
|
event_comp->HandleEvent(evt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Application::Update(Duration dt)
|
void Application::Update(Duration dt)
|
||||||
{
|
{
|
||||||
// Before update
|
// Before update
|
||||||
|
|
@ -200,17 +216,6 @@ void Application::Render()
|
||||||
renderer.Present();
|
renderer.Present();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::DispatchEvent(Event* evt)
|
|
||||||
{
|
|
||||||
for (auto comp : modules_)
|
|
||||||
{
|
|
||||||
if (auto event_comp = comp->Cast<EventModule>())
|
|
||||||
{
|
|
||||||
event_comp->HandleEvent(evt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::PreformInMainThread(Function<void()> func)
|
void Application::PreformInMainThread(Function<void()> func)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(perform_mutex_);
|
std::lock_guard<std::mutex> lock(perform_mutex_);
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,13 @@
|
||||||
|
|
||||||
namespace kiwano
|
namespace kiwano
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \~chinese
|
||||||
|
* @brief 获取版本号
|
||||||
|
*/
|
||||||
|
extern KGE_API int GetVersion();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \~chinese
|
* \~chinese
|
||||||
* @brief 应用程序,控制游戏的整个生命周期,包括初始化、启动、结束以及事件分发等
|
* @brief 应用程序,控制游戏的整个生命周期,包括初始化、启动、结束以及事件分发等
|
||||||
|
|
@ -70,12 +77,6 @@ public:
|
||||||
*/
|
*/
|
||||||
WindowPtr GetMainWindow() const;
|
WindowPtr GetMainWindow() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* \~chinese
|
|
||||||
* @brief 获取版本号
|
|
||||||
*/
|
|
||||||
int GetVersion() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \~chinese
|
* \~chinese
|
||||||
* @brief 添加模块
|
* @brief 添加模块
|
||||||
|
|
@ -92,6 +93,14 @@ public:
|
||||||
*/
|
*/
|
||||||
void SetTimeScale(float scale_factor);
|
void SetTimeScale(float scale_factor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \~chinese
|
||||||
|
* @brief 分发事件
|
||||||
|
* @details 将事件分发给所有事件功能模块
|
||||||
|
* @param evt 事件
|
||||||
|
*/
|
||||||
|
void DispatchEvent(EventPtr evt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \~chinese
|
* \~chinese
|
||||||
* @brief 分发事件
|
* @brief 分发事件
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue