int hokuyo_init(HokuyoURG* urg){ if (urg->fd<=0){ return -1; } #ifdef HOKUYO_ALWAYS_IN_SCIP20 fprintf(stderr, "\nAssuming laser is already in SCIP2.0 mode!\n"); fprintf(stderr, " (if the dirver hangs, either your Hokuyo has the old\n"); fprintf(stderr, " firmware or you have to disable -DHOKUYO_ALWAYS_IN_SCIP20\n"); fprintf(stderr, " in the Makefile of the laser driver)\n"); urg->isContinuous=0; urg->isProtocol2=1; #else // stop the device anyhow fprintf(stderr, "Stopping the device... "); wcm(HK_QUIT); wcm(HK_QUIT); wcm(HK_QUIT); fprintf(stderr, "done\n"); urg->isContinuous=0; // put the urg in SCIP2.0 Mode fprintf(stderr, "Switching to enhanced mode (SCIP2.0)... "); fprintf(stderr, " (if the dirver hangs you probably configured your Hokuyo\n"); fprintf(stderr, " so that SCIP is alwas on. IN this case, enable the Option\n"); fprintf(stderr, " CFLAGS += -DHOKUYO_ALWAYS_IN_SCIP20\n"); fprintf(stderr, " in the Makefile of the laser driver)\n"); int status=hokuyo_readStatus(urg, HK_SCIP); if (status==0){ fprintf(stderr, "\nSwitching to SCIP 2.0 was successful!\n"); urg->isProtocol2=1; } else { fprintf(stderr, "Error. Unable to switch to SCIP2.0 Mode, please upgrade the firmware of your device.\n"); return -1; } #endif fprintf(stderr, "Device initialized successfully\n"); urg->isInitialized=1; return 1; }
void WindowWin32::Initialize() { HINSTANCE hInstance = Win32::GetAppInstance(); WinClassMaker wcm(hInstance, MY_WNDCLS_NAME, WndProc); wcm.Register(); WinMaker wm(hInstance, MY_WNDCLS_NAME); wm.SetSize(m_iWidth, m_iHeight); m_hWnd = wm.Create(m_sTitle.c_str(), this); // init renderer if (GetRenderer().get()) GetRenderer()->Initialize(this); }
void Button::createMe(HWND hParent) { Component::createMe(hParent); HINSTANCE hInst = Global::getHINSTANCE(); WinClassMaker wcm(hInst, "UxButton", ButtonWndProc); wcm.registerMe(); ChildWinMaker wm(hInst, "UxButton"); wm.setPos(x_, y_); wm.setSize(bitmaps_[ST_NORMAL].width(), bitmaps_[ST_NORMAL].height()); hWnd_ = wm.create(hParent, this); ::ShowWindow(hWnd_, SW_SHOWNORMAL); ::UpdateWindow(hWnd_); }