本文整理汇总了C++中Application::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ Application::Initialize方法的具体用法?C++ Application::Initialize怎么用?C++ Application::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::Initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
Application game;
MSG msg;
long prevTick, curTick = GetTickCount();
game.Initialize();
while(true)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message==WM_QUIT)break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
prevTick = curTick;
curTick = GetTickCount();
game.Update((curTick - prevTick)/1000.f);
game.Render();
}
return 0;
}
示例2: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
Application app;
app.Initialize();
app.Run();
return 0;
}
示例3: main
int main(int argc, char** argv) {
Application app;
app.Initialize();
app.Run();
app.Terminate();
return 0;
}
示例4: wWinMain
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR cmdLine, int cmdShow)
{
UNREFERENCED_PARAMETER(prevInstance);
UNREFERENCED_PARAMETER(cmdLine);
Application application = Application();
application.Initialize(hInstance, cmdShow);
return application.Run();
}
示例5: main
int main()
{
Application application;
if (!application.Initialize(L"resources/scene6.test"))
return -1;
application.Render();
application.Shutdown();
return 0;
}
示例6: wWinMain
INT WINAPI wWinMain(HINSTANCE,HINSTANCE,LPWSTR,INT)
{
(void)HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
Application application; // Manages the application logic.
if (application.Initialize())
{
application.MessageLoop();
}
return 0;
}
示例7: WinMain
// Application runtime ----------------------------------------------------------------
Int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pScmdline, Int iCmdshow)
{
Application* Instance;
// Create the application instance
Instance = new Application();
if(!Instance) { return 0; }
// Initialize and run the application instance
if(Instance->Initialize()) { Instance->Run(); }
// Shutdown and release the application instance
Instance->Shutdown(); delete Instance;
Instance = nullptr;
_CrtDumpMemoryLeaks();
return 0;
}
示例8: main
int main(int argc, char* args[])
{
//Create the only instance of the App
Application* mainApp = Application::GetApp();
if (mainApp == nullptr)
{
//Print to output
Log::GetLog().LogCriticalMsg("Failed to create mainApp");
}
if (!mainApp->Initialize())
{
Log::GetLog().LogCriticalMsg("Failed to Init mainApp");
}
mainApp->Run();
return 0;
}
示例9: main
int main(int argc, char **argv)
#endif
{
// Create application object
Application app;
try {
app.Initialize();
}
catch (Ogre::Exception& e) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox(nullptr, (wchar_t*)e.getFullDescription().c_str(), L"An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
fprintf(stderr, "An exception has occured: %s\n",
e.getFullDescription().c_str());
#endif
}
return 0;
}
示例10: main
int main(int argc, char *argv[])
{
Application app;
app.Initialize();
while (!app.quit) {
app.GameInput();
if (app.GameManager->MainGame) {
app.Loop();
}
else if (app.GameManager->EndMenu) {
app.DeathScreen();
}
else if (app.GameManager->MainMenu) {
app.MainMenu();
}
}
SDL_Quit();
return 0;
}
示例11: Application
int WINAPI
WinMain(HINSTANCE hInst, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */, int nCmdShow)
{
if (SUCCEEDED(CoInitialize(0))) {
Application* app = new Application();
if (SUCCEEDED(app->Initialize(hInst, nCmdShow))) {
int num;
LPWSTR* args = CommandLineToArgvW(GetCommandLine(), &num);
if (args) {
if (num > 1) {
app->SetImageFile(args[1]);
}
}
app->RunMessageLoop();
LocalFree(args);
}
delete app;
CoUninitialize();
}
return 0;
}
示例12: WinMain
int WINAPI WinMain( HINSTANCE hInst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow)
{
#if defined(DEBUG) || defined(_DEBUG)
FIND_MEMORY_LEAKS;
#endif
#ifdef TEST
SmartPtrArr<int> myarr;
myarr = new int[10];
for (int i = 0; i < 10; i++)
{
myarr[i] = i;
}
char tex[10];
for (int i = 0; i < 10; i++)
{
char t[1];
itoa(i, t, 10);
tex[i] = t[0];
}
#else
Application app;
if(!app.Initialize(hInst))
return cmdShow;
app.Run();
app.Shutdown();
return cmdShow;
#endif
}
示例13: WinMain
int WINAPI WinMain(
HINSTANCE /* hInstance */,
HINSTANCE /* hPrevInstance */,
LPSTR /* lpCmdLine */,
int /* nCmdShow */
)
{
//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
EasyServer::GetInstance();
//DevConsoleCreate();
//ShellExecute(NULL, L"open", L"C:\\Users\\Administrator\\Documents\\TangoMike\\Src\\TangoMike\\Release\\TangoMike.exe", NULL, NULL, SW_SHOWNORMAL);
std::srand(unsigned(std::time(0)));
// Ignoring the return value because we want to continue running even in the
// unlikely event that HeapSetInformation fails.
//HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
if (SUCCEEDED(CoInitialize(NULL)))
{
{
XMLBackup::GetInstance()->LoadData();
Application app;
Relationship::GetInstance()->LoadDataFromXMLBackup();
if (SUCCEEDED(app.Initialize()))
{
app.RunMessageLoop();
}
}
CoUninitialize();
}
Relationship::FreeInstance();
XMLBackup::FreeInstance();
EasyServer::FreeInstance();
return 0;
}
示例14: main
int main()
{
// Our application initialization params
Application::InitializationParams initParams = {};
initParams.sApplicationName = "Chronicles of a Fallen Soul";
initParams.sEngineName = "Wonderland";
initParams.sApplicationVersion = VK_MAKE_VERSION(0, 0, 1);
initParams.sEngineVersion = VK_MAKE_VERSION(0, 0, 1);
initParams.sTotalNumberPeonThreads = 4;
initParams.sThreadRingBufferSize = 65000;
// Create and initialize the main application
Application mainApplication = {};
if (!mainApplication.Initialize(initParams))
{
return false;
}
// Run the main loop
mainApplication.MainLoop();
//
bool result;
//
// Get all creator a register instances we need
Flux::ClassCreator* classCreatorInstance = Flux::ClassCreator::GetInstance();
Flux::ClassRegister* classRegisterInstance = Flux::ClassRegister::GetInstance();
Flux::TypeCreator* typeCreatorInstance = Flux::TypeCreator::GetInstance();
Flux::TypeRegister* typeRegisterInstance = Flux::TypeRegister::GetInstance();
Flux::DynamicMemberFunctionCreator* memberFunctionCreatorInstance = Flux::DynamicMemberFunctionCreator::GetInstance();
// Basic type registration //
Flux::Type* intType = typeCreatorInstance->CreateType("int");
Flux::Type* floatType = typeCreatorInstance->CreateType("float");
Flux::Type* charType = typeCreatorInstance->CreateType("char");
Flux::Type* stringType = typeCreatorInstance->CreateType("string");
Flux::Type* booleanType = typeCreatorInstance->CreateType("bool");
Flux::Type* vectorType = typeCreatorInstance->CreateType("vector");
// Class creation //
// Create a new class
Flux::Class* newClass = classCreatorInstance->CreateClass("Car");
if (newClass == nullptr)
{
return false;
}
// Create a variable from the created class
Flux::MemberVariable speedVariable;
result = speedVariable.Build(floatType, "m_Speed");
if (!result)
{
return false;
}
// Add the member variable
result = newClass->AddMemberVariable(speedVariable);
if(!result)
{
return false;
}
// Create a variable from the created class
Flux::MemberVariable distanceVariable;
result = distanceVariable.Build(intType, "m_CurrentDistance");
if (!result)
{
return false;
}
// Add the member variable
result = newClass->AddMemberVariable(speedVariable);
if (!result)
{
return false;
}
// Create a variable from the created class
Flux::MemberVariable costVariable;
result = costVariable.Build(floatType, "m_CostPerDistance");
if (!result)
{
return false;
}
// Add the member variable
result = newClass->AddMemberVariable(speedVariable);
if (!result)
{
return false;
}
// Function creation //
// Create the nem member function
Flux::DynamicMemberFunction* newFunction = memberFunctionCreatorInstance->CreateDynamicMemberFunction("CalculateTime", *newClass);
//.........这里部分代码省略.........
示例15: wmain
int wmain(int argc, wchar_t* argv[])
{
CommandLineArgs args;
Application application;
try
{
#if _DEBUG
MessageBoxW(0, argv[1], 0, 0);
#endif
application.Initialize();
if (!args.ProcessCommandLine(argc, argv))
{
args.WriteOutput();
return 0;
}
int result = 0;
OpcUa_StatusCode uStatus = OpcUa_Good;
if (args.StorePath.length() > 0)
{
OpcUa_Char* wszFilePath = 0;
uStatus = OpcUa_StringToUnicode((OpcUa_StringA)args.StorePath.c_str(), &wszFilePath);
if (OpcUa_IsBad(uStatus))
{
args.OutputParameters["-error"] = "Could not access certificate store.";
args.OutputParameters["-storePath"] = args.StorePath;
args.WriteOutput();
return 0;
}
// create the store.
result = _wmkdir((wchar_t*)wszFilePath);
if (result != 0)
{
result = errno;
}
OpcUa_Free(wszFilePath);
wszFilePath = 0;
}
if (result != 0 && result != EEXIST)
{
if (_strnicmp(args.StorePath.c_str(), "LocalMachine", strlen("LocalMachine")) != 0 && _strnicmp(args.StorePath.c_str(), "CurrentUser", strlen("CurrentUser")) != 0)
{
args.OutputParameters["-error"] = "Could not access certificate store.";
args.OutputParameters["-storePath"] = args.StorePath;
args.WriteOutput();
return 0;
}
}
// create a new certificate.
if (args.Command.empty() || args.Command == "issue")
{
application.Issue(args);
args.WriteOutput();
return 0;
}
// revoke a certificate
if (args.Command == "revoke" || args.Command == "unrevoke")
{
application.Revoke(args);
args.WriteOutput();
return 0;
}
// convert a certificate
if (args.Command == "convert" || args.Command == "install")
{
application.Convert(args);
args.WriteOutput();
return 0;
}
// convert a replace
if (args.Command == "replace")
{
application.Replace(args);
args.WriteOutput();
return 0;
}
// create a certificate request.
if (args.Command == "request")
{
application.CreateRequest(args);
args.WriteOutput();
return 0;
}
// process a certificate request.
if (args.Command == "process")
//.........这里部分代码省略.........