private void OnDeviceOrientationChanged(int orientation) { var deviceOrientation = ConvertFromiOSOrientation(orientation); if (deviceOrientation != m_deviceOrientation) { PlatformEvents.SendDeviceOrientationEvent(this, new DeviceOrientationEvent((int)deviceOrientation)); m_deviceOrientation = deviceOrientation; } }
private void OnDeviceOrientationChanged(int orientation) { var deviceOrientation = ConvertFromAndroidOrientation(orientation); if (deviceOrientation != m_DeviceOrientation) { PlatformEvents.SendDeviceOrientationEvent(this, new DeviceOrientationEvent((int)deviceOrientation)); if ((deviceOrientation & m_ScreenOrientationMask) != 0) { AndroidNativeCalls.setOrientation(orientation); } m_DeviceOrientation = deviceOrientation; } }
private void UpdateDisplayInfo(bool firstTime) { int screenOrientation = 0; iOSNativeCalls.getScreenOrientation(ref screenOrientation); m_screenOrientation = ConvertFromiOSOrientation(screenOrientation); var config = GetSingleton <DisplayInfo>(); if (firstTime) { config.focused = true; config.visible = true; config.screenDpiScale = 1.0f; config.orientation = m_screenOrientation; } int sw = 0, sh = 0; iOSNativeCalls.getScreenSize(ref sw, ref sh); int winw = 0, winh = 0; iOSNativeCalls.getWindowSize(ref winw, ref winh); if (firstTime || m_screenOrientation != config.orientation || sw != config.screenWidth || sh != config.screenHeight || winw != config.width || winh != config.height || config.framebufferWidth != config.width || config.framebufferHeight != config.height) { Console.WriteLine($"iOS Window update, screen size {sw} x {sh}, window size {winw} x {winh}, orientation {(int)m_screenOrientation}"); if (config.orientation != m_screenOrientation) { PlatformEvents.SendScreenOrientationEvent(this, new ScreenOrientationEvent((int)m_screenOrientation)); config.orientation = m_screenOrientation; } config.screenWidth = sw; config.screenHeight = sh; if (config.autoSizeToFrame) { config.width = sw; config.height = sh; } iOSNativeCalls.setWindowSize(config.width, config.height); config.frameWidth = config.width; config.frameHeight = config.height; config.framebufferWidth = config.width; config.framebufferHeight = config.height; SetSingleton(config); } }
static void ManagedOnDestroyCallback() { PlatformEvents.SendQuitEvent(sWindowSystem, new QuitEvent()); }
static void ManagedOnPauseCallback(int pause) { PlatformEvents.SendSuspendResumeEvent(sWindowSystem, new SuspendResumeEvent(pause != 0)); }