本文整理匯總了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;
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例8: main
int main(int argc, char* argv[])
{
bool fRet = false;
fRet = AppInit(argc, argv);
if (fRet && fDaemon)
pthread_exit((void*)0);
}
示例9: main
int main(int argc, char* argv[])
{
SetupEnvironment();
// Connect bitcoind signal handlers
noui_connect();
return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
}
示例10: main
int main(int argc, char* argv[])
{
SetupEnvironment();
// Connect bitcoind signal handlers
noui_connect();
return (AppInit(argc, argv) ? 0 : 1);
}
示例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();
}
示例12: main
int main(int argc, char* argv[])
{
bool fRet = false;
fRet = AppInit(argc, argv);
if (fRet && fDaemon)
return 0;
return 1;
}
示例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();
}
示例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);
}
示例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);
}