bool CFuncAreaPortalWindow::UpdateVisibility( const Vector &vOrigin, float fovDistanceAdjustFactor, bool &bIsOpenOnClient ) { if ( IsWindowOpen( vOrigin, fovDistanceAdjustFactor ) ) { return BaseClass::UpdateVisibility( vOrigin, fovDistanceAdjustFactor, bIsOpenOnClient ); } else { bIsOpenOnClient = false; return false; } }
bool WindowBase::CloseWindow(bool mainbreak) { if ( IsWindowOpen() ) { EventClose(); if( mIsEventEnable ) DisableEvent(); ::DisposeWindow(mWindowHandle); return true; } return false; }
bool WindowBase::OpenWindow(int width, int height, const String& name, uint32 windowstyle, bool show) { if ( IsWindowOpen() ) CloseWindow(); if ( IsWindowBind() ) UnbindWindow(); mWindowHandle = NULL; ::Rect rectWin = {0, 0, height, width }; WindowAttributes winAttribute = (windowstyle & WINDOW_FRAME) ? kWindowStandardDocumentAttributes : 0; if ( !(windowstyle & WINDOW_SIZE) ) winAttribute &= ~kWindowResizableAttribute; if ( !(windowstyle & WINDOW_MINIMIZE) ) winAttribute &= ~kWindowFullZoomAttribute; winAttribute |= kWindowStandardHandlerAttribute|kWindowMetalAttribute; PRCORE_ASSERT_EXCEPTION( noErr != CreateNewWindow (kDocumentWindowClass,winAttribute, &rectWin,&mWindowHandle) ); mIsOpen = true; RenameWindow(name); ::SetWindowBounds ( mWindowHandle,kWindowContentRgn,&rectWin); EnableEvent(); if(show) ShowWindow(); ResizeWindow(width,height); if(show) { ::SetPortWindowPort(mWindowHandle); ::InvalWindowRect (mWindowHandle, &rectWin); MoveWindow(50,50); } return true; }