2019-03-12 00:27:54 +08:00
|
|
|
|
// Copyright (C) 2019 Nomango
|
2019-03-11 11:11:39 +08:00
|
|
|
|
|
|
|
|
|
|
#include "easy2d.h"
|
2019-03-13 15:48:25 +08:00
|
|
|
|
#include "easy2d-imgui.h"
|
2019-03-14 17:55:06 +08:00
|
|
|
|
#include "MainScene.h"
|
2019-03-12 00:27:54 +08:00
|
|
|
|
|
2019-03-11 11:11:39 +08:00
|
|
|
|
using namespace easy2d;
|
|
|
|
|
|
|
|
|
|
|
|
class ImGuiApp
|
|
|
|
|
|
: public Application
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
ImGuiApp()
|
|
|
|
|
|
{
|
2019-03-12 00:27:54 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD> ImGui <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
Use(&ImGuiView::Instance());
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>ʼ<EFBFBD><CABC>
|
2019-03-14 17:55:06 +08:00
|
|
|
|
Options options(L"ImGui Demo", 1280, 800);
|
2019-03-11 11:11:39 +08:00
|
|
|
|
|
|
|
|
|
|
Init(options);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void OnStart() override
|
|
|
|
|
|
{
|
2019-03-14 17:55:06 +08:00
|
|
|
|
MainScenePtr scene = new MainScene;
|
2019-03-11 11:11:39 +08:00
|
|
|
|
EnterScene(scene);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2019-03-14 17:55:06 +08:00
|
|
|
|
int WINAPI wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
|
2019-03-11 11:11:39 +08:00
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ImGuiApp app;
|
|
|
|
|
|
app.Run();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (std::exception& e)
|
|
|
|
|
|
{
|
|
|
|
|
|
::MessageBoxA(nullptr, e.what(), "An exception has occurred!", MB_ICONERROR | MB_OK);
|
|
|
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|