int WINAPI wWinMain(HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */, LPWSTR lpCmdLine, int /* nCmdShow */) { LPWSTR* arg_list; int arg_num = 0; // Ignore 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))) { App *app = new App(); arg_list = CommandLineToArgvW(lpCmdLine, &arg_num); if (arg_num == 2) { CardData data; strcpy_s(data.username, ws2s(arg_list[0]).c_str()); strcpy_s(data.password, ws2s(arg_list[1]).c_str()); try { NFC_READER->Initialize(); NFC_READER->Write(data); NFC_READER->Uninitialize(); } catch (...) { MessageBox(NULL, L"שגיאה התרחשה בכתיבה לכרטיס או שלא נמצא כרטיס...", L"שים/י לב!", STDMSGBOX | MB_ICONWARNING); return 1; } return 0; } if (SUCCEEDED(app->Initialize())) { app->ChangeScreenTo(App::Screens::WaitingToCardScreen); MSG msg; memset(&msg, 0, sizeof(msg)); while (app->AppMode != -1) { if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } app->Update(); app->Render(); } } delete app; CoUninitialize(); } return 0; }
INT APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, INT nCmdShow) { C3DUINT16 uiWidth = 400; C3DUINT16 uiHeight = 300; Core3D::CreationFlags kCreateFlags; kCreateFlags.strWindowTitle = _T("DisplacedSphere"); kCreateFlags.hIcon = ::LoadIcon(::GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1)); kCreateFlags.uiWindowWidth = uiWidth; kCreateFlags.uiWindowHeight = uiHeight; kCreateFlags.bWindowed = true; App kApp; if(false == kApp.Initialize(kCreateFlags)) {return 1;} return kApp.Run(); }
int main(int argc, char *argv[]) { App app; app.Initialize(argc, argv); Controller *controller = new Controller(); app.SetController(controller); Scene *scene = new Scene(); controller->SetScene(scene); Layer *layer = new Layer(); scene->AddLayer(layer); GameObject *go = new GameObject(); go->LoadTexture("../helloworld/helloworld.png"); AddComponent<TestComp>(go); layer->AddChild(go); return app.MainLoop(); }