當前位置: 首頁>>代碼示例>>C++>>正文


C++ AppInit函數代碼示例

本文整理匯總了C++中AppInit函數的典型用法代碼示例。如果您正苦於以下問題:C++ AppInit函數的具體用法?C++ AppInit怎麽用?C++ AppInit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AppInit函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: main

int main(int argc, char* argv[])
{
    for (int i = 1; i < argc; i++)
        if (!IsSwitchChar(argv[i][0]))
            fCommandLine = true;
    fDaemon = !fCommandLine;

#ifdef __WXGTK__
    if (!fCommandLine)
    {
        // Daemonize
        pid_t pid = fork();
        if (pid < 0)
        {
            fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno);
            return 1;
        }
        if (pid > 0)
            pthread_exit((void*)0);
    }
#endif

    if (!AppInit(argc, argv))
        return 1;

    while (!fShutdown)
        Sleep(1000000);
    return 0;
}
開發者ID:DarrellDuane,項目名稱:bitcoin,代碼行數:29,代碼來源:init.cpp

示例2: AppMain

void AppMain()
{
    AppInit(1280, 720, "silver-winner");

    for (;;)
    {
        MSG msg;
        while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessageW(&msg);
        }

        if (g_App.bShouldClose)
        {
            break;
        }

        ImGui_ImplDX11_NewFrame();

        RendererPaint();
    }

    AppExit();
}
開發者ID:nlguillemot,項目名稱:silver-winner,代碼行數:25,代碼來源:app.cpp

示例3: AppInit

void VAppBase::Execute(VAppImpl* pImpl)
{
  // Early out in case one of the startup modules triggered a quit
  if (WantsToQuit())
    return;

  if(pImpl == NULL)
  {
    hkvLog::FatalError("No implmentation found!");
    return;
  }
  
  m_pAppImpl = pImpl;
	Vision::SetApplication(this);

  // On callback based platforms the remaining code of the execute function
  // is triggered via the corresponding platform specific functions
  if (IsCallbackBased())
    return;

  AppInit();
  {
    // Main application loop (non callback based platforms only)
    bool bRun = true;
    while (bRun)
    {
      bRun = AppRun();
    }
  }
  AppDeInit();
}
開發者ID:Niobij,項目名稱:AnarchoidTemplate,代碼行數:31,代碼來源:VAppBase.cpp

示例4: WinMain

int PASCAL WinMain (HINSTANCE instance_in, HINSTANCE previous_instance,
  LPSTR command_line, int show_style)
{

 	MSG		  msg;

  instance = instance_in;
  WinInit ();
  AppInit ();
  while (!quit) {
		if (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))	{
			if (msg.message == WM_QUIT)
				quit = true;
			else {
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
    } else
      AppUpdate ();

  }
  AppTerm ();
  return 0;

}
開發者ID:livibetter-backup,項目名稱:pixel-city,代碼行數:25,代碼來源:Win.cpp

示例5: main

int     main() /** no params because they're not used */
{
    // Acronyms acr;
    // AcronymsInit(&acr);
    // acr.activate(&acr, (e_acronyms)4);
    // acr.activate(&acr, (e_acronyms)5);
    // acr.activate(&acr, (e_acronyms)1);
    // acr.activate(&acr, (e_acronyms)0);
    // for (int i = 0; i < 12; i++)
    // {
    //     std::cout << "[" << i << "] " << acr.names[i] << " = ";
    //     std::cout << (acr.selected[i] ? "(true)" : "(false)") << std::endl;
    // }
    // std::cout << acr.ToString(&acr) << std::endl;
    // std::cout << acr.CSVFormatter(&acr) << std::endl;
    // std::cout << acr.CountSelected(&acr) << std::endl;
    // std::cout << acr << std::endl;

    Application app;

    //todo();

    AppInit(&app); /** initialisation of the `app` structure and reading data from file*/
    app.Start(&app); /** start of the inifinite loop in the function `loop` */
    app.Loop(&app); /** execution of the infinite loop */

    AppDestroy(&app); /** cleaning of the structure and saving data */
    return (EXIT_SUCCESS);
}
開發者ID:pantzerbrendan,項目名稱:uqar,代碼行數:29,代碼來源:main.cpp

示例6: main

int main(void)
{

	BYTE	stBtn1;
	BYTE	stBtn2;

	DeviceInit();
	AppInit();

        
        while(stBtn1!=stPressed && stBtn2!=stPressed)
        {
            mT5IntEnable(fFalse);
            stBtn1 = btnBtn1.stBtn;
            stBtn2 = btnBtn2.stBtn;
            mT5IntEnable(fTrue);
        }

        RightReverse;
        LeftReverse;
        SetLeftSpeed(dtcMtrMedium);
        SetRightSpeed(dtcMtrMedium);

        mCNIntEnable(fTrue);	//Sensors will trigger
        while(fTrue);
}
開發者ID:notbryant,項目名稱:project-stupid-robot,代碼行數:26,代碼來源:main.c

示例7: RunSharkfund

std::tuple<bool, boost::thread*> RunSharkfund(int argc, char* argv[])
{
	boost::thread* detectShutdownThread = NULL;
	static boost::thread_group threadGroup;
	SetupEnvironment();

	bool fRet = false;

	// Connect Dacrsd signal handlers
	noui_connect();

	fRet = AppInit(argc, argv,threadGroup);

	detectShutdownThread = new boost::thread(boost::bind(&DetectShutdownThread, &threadGroup));

	if (!fRet) {
		if (detectShutdownThread)
			detectShutdownThread->interrupt();

		threadGroup.interrupt_all();

		// threadGroup.join_all(); was left out intentionally here, because we didn't re-test all of
		// the startup-failure cases to make sure they don't result in a hang due to some
		// thread-blocking-waiting-for-another-thread-during-startup case
	}
  return std::make_tuple (fRet,detectShutdownThread);
}
開發者ID:sharkfund001,項目名稱:sharkfund,代碼行數:27,代碼來源:sharkfundd.cpp

示例8: main

int main(int argc, char* argv[])
{
    bool fRet = false;
    fRet = AppInit(argc, argv);

    if (fRet && fDaemon)
        pthread_exit((void*)0);
}
開發者ID:dmp1ce,項目名稱:namecoin,代碼行數:8,代碼來源:init.cpp

示例9: main

int main(int argc, char* argv[])
{
    SetupEnvironment();

    // Connect bitcoind signal handlers
    noui_connect();

    return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
}
開發者ID:SolidXPartners,項目名稱:bitcoin,代碼行數:9,代碼來源:bitcoind.cpp

示例10: main

int main(int argc, char* argv[])
{
    SetupEnvironment();

    // Connect bitcoind signal handlers
    noui_connect();

    return (AppInit(argc, argv) ? 0 : 1);
}
開發者ID:florincoin,項目名稱:florincoin,代碼行數:9,代碼來源:bitcoind.cpp

示例11: NativeException

void NativeApplication::Initialize(float vertOffset, float rotStep)
{
	if (rotStep > 10.0f)
		throw NativeException("too big rotation step!");

	rotStep *= 2.0f * 3.14159265359f / 360.0f;
	AppInit(vertOffset, rotStep);
	GenerateVertexData();
}
開發者ID:vbasanovic,項目名稱:Monre,代碼行數:9,代碼來源:NativeApplication.cpp

示例12: main

int main(int argc, char* argv[])
{
    bool fRet = false;
    fRet = AppInit(argc, argv);

    if (fRet && fDaemon)
        return 0;

    return 1;
}
開發者ID:fconcklin,項目名稱:namecoin,代碼行數:10,代碼來源:init.cpp

示例13: Init

void Init() {
    Uart.Init(115200);
    Uart.Printf("usb AHB=%u; APB1=%u; APB2=%u; UsbSdio=%u\r\n", Clk.AHBFreqHz, Clk.APB1FreqHz, Clk.APB2FreqHz, Clk.UsbSdioFreqHz);
    Usb.Init();
    Usb.Disconnect();
    chThdSleepMilliseconds(999);
    Usb.Connect();
    // Application init
    AppInit();
}
開發者ID:Kreyl,項目名稱:nute,代碼行數:10,代碼來源:main.cpp

示例14: main

int main(int argc, char* argv[])
{
    RegisterPrettyTerminateHander();
    RegisterPrettySignalHandlers();

    SetupEnvironment();

    // Connect dashd signal handlers
    noui_connect();

    return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
}
開發者ID:dashpay,項目名稱:dash,代碼行數:12,代碼來源:dashd.cpp

示例15: main

int main(int argc, char* argv[])
{
    bool fRet = false;

    // Connect darksilkd signal handlers
    noui_connect();

    fRet = AppInit(argc, argv);

    if (fRet && fDaemon)
        return 0;

    return (fRet ? 0 : 1);
}
開發者ID:kevinjulio,項目名稱:fantom,代碼行數:14,代碼來源:darksilkd.cpp


注:本文中的AppInit函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。