1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- /****************************************************************************
- * Copyright 2019 Nreal Techonology Limited. All rights reserved.
- *
- * This file is part of NRSDK.
- *
- * https://www.nreal.ai/
- *
- *****************************************************************************/
- namespace NRKernal
- {
- public class NRDisplaySubsystemDescriptor : IntegratedSubsystemDescriptor<NRDisplaySubsystem>
- {
- public const string Name = "Subsystem.Display";
- public override string id => Name;
- }
- public class NRDisplaySubsystem : IntegratedSubsystem<NRDisplaySubsystemDescriptor>
- {
- internal static NativeMultiDisplay NativeMultiDisplay { get; private set; }
- public NRDisplaySubsystem(NRDisplaySubsystemDescriptor descriptor) : base(descriptor)
- {
- NativeMultiDisplay = new NativeMultiDisplay();
- #if !UNITY_EDITOR
- NativeMultiDisplay.Create();
- #endif
- }
- public override void Start()
- {
- if (running)
- {
- return;
- }
- base.Start();
- #if !UNITY_EDITOR
- NativeMultiDisplay.Start();
- #endif
- }
- public override void Pause()
- {
- if (!running)
- {
- return;
- }
- base.Pause();
- #if !UNITY_EDITOR
- NativeMultiDisplay.Pause();
- #endif
- }
- public override void Resume()
- {
- if (running)
- {
- return;
- }
- base.Resume();
- #if !UNITY_EDITOR
- NativeMultiDisplay.Resume();
- #endif
- }
- public override void Stop()
- {
- if (!running)
- {
- return;
- }
- base.Stop();
- #if !UNITY_EDITOR
- NativeMultiDisplay.Stop();
- NativeMultiDisplay.Destroy();
- #endif
- }
- internal void ListenMainScrResolutionChanged(NRDisplayResolutionCallback callback)
- {
- #if !UNITY_EDITOR
- NativeMultiDisplay.ListenMainScrResolutionChanged(callback);
- #endif
- }
- }
- }
|