2015-11-21 01:16:07 +00:00
|
|
|
#include <LogVisor/LogVisor.hpp>
|
|
|
|
#include <boo/boo.hpp>
|
|
|
|
#include <Specter/Specter.hpp>
|
|
|
|
|
|
|
|
namespace RUDE
|
|
|
|
{
|
|
|
|
|
|
|
|
struct Application : boo::IApplicationCallback
|
|
|
|
{
|
2015-11-22 04:35:24 +00:00
|
|
|
HECL::Runtime::FileStoreManager m_fileMgr;
|
|
|
|
Specter::FontCache m_fontCache;
|
|
|
|
Specter::RootView m_rootView;
|
2015-11-21 01:16:07 +00:00
|
|
|
boo::IWindow* m_mainWindow;
|
2015-11-22 04:35:24 +00:00
|
|
|
bool m_running = true;
|
|
|
|
|
|
|
|
Application() : m_fileMgr(_S("rude")), m_fontCache(m_fileMgr), m_rootView(m_fontCache) {}
|
|
|
|
|
2015-11-21 01:16:07 +00:00
|
|
|
int appMain(boo::IApplication* app)
|
|
|
|
{
|
|
|
|
m_mainWindow = app->newWindow(_S("RUDE"));
|
2015-11-22 04:35:24 +00:00
|
|
|
m_rootView.setWindow(m_mainWindow, 1.0f);
|
|
|
|
|
|
|
|
while (m_running)
|
|
|
|
{
|
|
|
|
m_mainWindow->waitForRetrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-21 01:16:07 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
void appQuitting(boo::IApplication*)
|
|
|
|
{
|
2015-11-22 04:35:24 +00:00
|
|
|
m_running = false;
|
2015-11-21 01:16:07 +00:00
|
|
|
}
|
|
|
|
void appFilesOpen(boo::IApplication*, const std::vector<boo::SystemString>&)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2015-11-22 04:35:24 +00:00
|
|
|
|
|
|
|
|
2015-11-21 01:16:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#if _WIN32
|
|
|
|
int wmain(int argc, const boo::SystemChar** argv)
|
|
|
|
#else
|
|
|
|
int main(int argc, const boo::SystemChar** argv)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
LogVisor::RegisterConsoleLogger();
|
|
|
|
RUDE::Application appCb;
|
|
|
|
int ret = ApplicationRun(boo::IApplication::EPlatformType::Auto,
|
|
|
|
appCb, _S("rude"), _S("RUDE"), argc, argv);
|
|
|
|
printf("IM DYING!!\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if _WIN32
|
|
|
|
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int)
|
|
|
|
{
|
|
|
|
int argc = 0;
|
|
|
|
const boo::SystemChar** argv = (const wchar_t**)(CommandLineToArgvW(lpCmdLine, &argc));
|
|
|
|
static boo::SystemChar selfPath[1024];
|
|
|
|
GetModuleFileNameW(nullptr, selfPath, 1024);
|
|
|
|
static const boo::SystemChar* booArgv[32] = {};
|
|
|
|
booArgv[0] = selfPath;
|
|
|
|
for (int i=0 ; i<argc ; ++i)
|
|
|
|
booArgv[i+1] = argv[i];
|
|
|
|
|
|
|
|
LogVisor::CreateWin32Console();
|
|
|
|
return wmain(argc+1, booArgv);
|
|
|
|
}
|
|
|
|
#endif
|