Ejemplo n.º 1
0
 void resourceWindow_CreateInternalResources(OSWindow window, InternalResourceType resourceType)
 {
     if ((resourceType & InternalResourceType.Sound) == InternalResourceType.Sound)
     {
         openALManager.resumeAudio();
     }
 }
Ejemplo n.º 2
0
        public BrowsePopup(
            string name,
            Vector2i size,
            IClydeWindow ownerWindow)
        {
            WindowDescriptor popupWindowDescriptor = new WindowDescriptor(name, new() {
                new ControlDescriptorMain()
                {
                    Name = "main",
                    Size = size
                },
                new ControlDescriptorBrowser()
                {
                    Name    = "browser",
                    Size    = size,
                    Anchor1 = new Vector2i(0, 0),
                    Anchor2 = new Vector2i(100, 100)
                }
            });

            WindowElement = new ControlWindow(popupWindowDescriptor);
            WindowElement.CreateChildControls(IoCManager.Resolve <IDreamInterfaceManager>());

            _window = WindowElement.CreateWindow();
            _window.StartupLocation = WindowStartupLocation.CenterOwner;
            _window.Owner           = ownerWindow;
            _window.Closed         += OnWindowClosed;

            Browser = (ControlBrowser)WindowElement.ChildControls[0];
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor to have the renderer embed its primary window.
 /// </summary>
 /// <param name="embedWindow">The OSWindow to embed into.</param>
 public WindowInfo(OSWindow embedWindow, String name)
 {
     AutoCreateWindow = false;
     AutoWindowTitle  = name;
     EmbedWindow      = embedWindow;
     MonitorIndex     = 0;
 }
Ejemplo n.º 4
0
 private void MainWindow_DestroyInternalResources(OSWindow window, InternalResourceType resourceType)
 {
     if ((resourceType & InternalResourceType.LargeReloadableResources) == InternalResourceType.LargeReloadableResources)
     {
         virtualTextureManager.suspend();
     }
 }
Ejemplo n.º 5
0
 private void MainWindow_CreateInternalResources(OSWindow window, InternalResourceType resourceType)
 {
     if ((resourceType & InternalResourceType.LargeReloadableResources) == InternalResourceType.LargeReloadableResources)
     {
         virtualTextureManager.resume();
     }
 }
Ejemplo n.º 6
0
 void resourceWindow_DestroyInternalResources(OSWindow window, InternalResourceType resourceType)
 {
     if ((resourceType & InternalResourceType.Sound) == InternalResourceType.Sound)
     {
         openALManager.suspendAudio();
     }
 }
Ejemplo n.º 7
0
        public SplashScreen(OSWindow window, uint progressRange, String splashScreenLayoutFile, String splashScreenResourceFile)
        {
            this.window     = window;
            window.Resized += window_Resized;
            SmoothShow      = true;

            Gui gui = Gui.Instance;

            ResourceManager.Instance.load(splashScreenResourceFile);
            layout     = LayoutManager.Instance.loadLayout(splashScreenLayoutFile);
            mainWidget = layout.getWidget(0);

            NumberParser.TryParse(mainWidget.getUserString("ImageWidth"), out imageWidth);
            NumberParser.TryParse(mainWidget.getUserString("ImageHeight"), out imageHeight);

            progressBar       = mainWidget.findWidget("SplashScreen/ProgressBar") as ProgressBar;
            progressBar.Range = progressRange;

            statusText           = mainWidget.findWidget("SplashScreen/Status") as TextBox;
            statusText.TextColor = Color.White;

            widgetPanel       = mainWidget.findWidget("WidgetPanel");
            widgetPanelWidth  = Math.Max(widgetPanel.Width, 1);
            widgetPanelHeight = Math.Max(widgetPanel.Height, 1);

            resizingWidgets = new List <Tuple <Widget, IntCoord> >((int)widgetPanel.ChildCount);
            resizingWidgets.AddRange(widgetPanel.Children.Where(c => c.isUserString("ResizeKeepAspectRatio")).Select(c => Tuple.Create(c, c.Coord)));

            resized();
        }
Ejemplo n.º 8
0
 void osWindow_DestroyInternalResources(OSWindow window, InternalResourceType resourceType)
 {
     if ((resourceType & InternalResourceType.Graphics) == InternalResourceType.Graphics)
     {
         renderWindow.destroyInternalResources(window.WindowHandle);
     }
 }
 void osWindow_Closed(OSWindow sender)
 {
     controller.destroyWindow(this);
     if (Closed != null)
     {
         Closed.Invoke(this, EventArgs.Empty);
     }
     OgreInterface.Instance.destroyRendererWindow(rendererWindow);
     controller.ActiveWindowChanged -= controller_ActiveWindowChanged;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="osWindow">The OSWindow.</param>
 /// <param name="renderWindow">The RenderWindow.</param>
 public EmbeddedWindow(OSWindow osWindow, RenderWindow renderWindow)
 {
     this.osWindow     = osWindow;
     this.renderWindow = renderWindow;
     osWindow.Moved   += osWindow_Moved;
     osWindow.Resized += osWindow_Resized;
     osWindow.Closing += osWindow_Closing;
     osWindow.CreateInternalResources  += osWindow_CreateInternalResources;
     osWindow.DestroyInternalResources += osWindow_DestroyInternalResources;
 }
Ejemplo n.º 11
0
 public void changeOSWindow(OSWindow newWindow)
 {
     if (window != null)
     {
         window.Resized -= resized;
     }
     this.window     = newWindow;
     window.Resized += resized;
     resized(window);
 }
Ejemplo n.º 12
0
 void resized(OSWindow window)
 {
     if (ScreenSizeChanging != null)
     {
         ScreenSizeChanging.Invoke(window.WindowWidth, window.WindowHeight);
     }
     layoutChain.WorkingSize = new IntSize2(window.WindowWidth, window.WindowHeight);
     layoutChain.layout();
     if (ScreenSizeChanged != null)
     {
         ScreenSizeChanged.Invoke(window.WindowWidth, window.WindowHeight);
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Set the window used to track when to create / destroy internal resources.
 /// Should be called with the main window, or else audio suspend / resume will
 /// not be detected.
 /// </summary>
 /// <param name="window">The OSWindow instance to listen to.</param>
 public void setResourceWindow(OSWindow window)
 {
     if (resourceWindow != null)
     {
         resourceWindow.CreateInternalResources  -= resourceWindow_CreateInternalResources;
         resourceWindow.DestroyInternalResources -= resourceWindow_DestroyInternalResources;
     }
     resourceWindow = window;
     if (resourceWindow != null)
     {
         resourceWindow.CreateInternalResources  += resourceWindow_CreateInternalResources;
         resourceWindow.DestroyInternalResources += resourceWindow_DestroyInternalResources;
     }
 }
Ejemplo n.º 14
0
        public RendererWindow createRendererWindow(WindowInfo windowInfo)
        {
            Dictionary <String, String> miscParams = new Dictionary <string, string>();
            String fsaa = OgreConfig.FSAA;

            if (fsaa.Contains("Quality"))
            {
                miscParams.Add("FSAAHint", "Quality");
            }
            int spaceIndex = fsaa.IndexOf(' ');

            if (spaceIndex != -1)
            {
                fsaa = fsaa.Substring(0, spaceIndex);
            }
            miscParams.Add("FSAA", fsaa);
            miscParams.Add("vsync", OgreConfig.VSync.ToString());
            miscParams.Add("monitorIndex", windowInfo.MonitorIndex.ToString());
            miscParams.Add("useNVPerfHUD", OgreConfig.UseNvPerfHUD.ToString());
            miscParams.Add("contentScalingFactor", windowInfo.ContentScalingFactor.ToString());
            OSWindow embedWindow = windowInfo.EmbedWindow;

            if (embedWindow != null)
            {
                miscParams.Add("externalWindowHandle", embedWindow.WindowHandle.ToString());
            }
            RenderWindow renderWindow = root.createRenderWindow(windowInfo.AutoWindowTitle, (uint)windowInfo.Width, (uint)windowInfo.Height, windowInfo.Fullscreen, miscParams);
            OgreWindow   ogreWindow;

            if (embedWindow != null)
            {
                ogreWindow = new EmbeddedWindow(embedWindow, renderWindow);
            }
            else
            {
                ogreWindow = new AutomaticWindow(new OgreOSWindow(renderWindow));
            }
            windowInfo._fireWindowCreated(new WindowInfoEventArgs(ogreWindow));
            return(ogreWindow);
        }
Ejemplo n.º 15
0
 void mainWindow_Closed(OSWindow window)
 {
     shutdown();
 }
Ejemplo n.º 16
0
        public RendererWindow createRendererWindow(OSWindow embedWindow, String name)
        {
            WindowInfo windowInfo = new WindowInfo(embedWindow, name);

            return(createRendererWindow(windowInfo));
        }
 void mainWindow_Closed(OSWindow window)
 {
     exit();
 }
Ejemplo n.º 18
0
 void mainWindow_Closed(OSWindow sender)
 {
     exit();
 }
Ejemplo n.º 19
0
 public GUIManager(MDILayoutManager mdiManager, OSWindow window)
 {
     this.mdiManager = mdiManager;
     this.window     = window;
 }
Ejemplo n.º 20
0
 public void windowChanged(OSWindow newWindow)
 {
     screenLayoutManager.changeOSWindow(newWindow);
 }
Ejemplo n.º 21
0
 private void OSWindow_Resized(OSWindow window)
 {
     renderListener.resized();
 }
Ejemplo n.º 22
0
 void window_Resized(OSWindow window)
 {
     fireSizeChanged(window.WindowWidth, window.WindowHeight);
 }
Ejemplo n.º 23
0
 void osWindow_Closing(OSWindow window)
 {
     renderWindow.setActive(false);
 }
Ejemplo n.º 24
0
 void osWindow_Resized(OSWindow window)
 {
     renderWindow.windowMovedOrResized();
 }
Ejemplo n.º 25
0
 public ScreenLayoutManager(OSWindow window)
 {
     this.window     = window;
     window.Resized += resized;
 }
Ejemplo n.º 26
0
 public void createGUI(MDILayoutManager mdiManager, LayoutChain layoutChain, OSWindow window)
 {
     doCreateGui(mdiManager, layoutChain, window);
 }
Ejemplo n.º 27
0
        private void doCreateGui(MDILayoutManager mdiManager, LayoutChain layoutChain, OSWindow window)
        {
            screenLayoutManager = new ScreenLayoutManager(window);
            screenLayoutManager.ScreenSizeChanging += ScreenLayoutManager_ScreenSizeChanging;
            screenLayoutManager.ScreenSizeChanged  += screenLayoutManager_ScreenSizeChanged;

            //Dialogs
            dialogManager = new DialogManager(mdiManager);

            screenLayoutManager.LayoutChain = layoutChain;
            layoutChain.CompactMode         = compactMode;

            ScreenLayoutManager_ScreenSizeChanging(window.WindowWidth, window.WindowHeight);
        }
Ejemplo n.º 28
0
 void window_Deactivated(OSWindow window)
 {
     fireReleaseAllKeys();
 }
Ejemplo n.º 29
0
 void window_Resized(OSWindow window)
 {
     resized();
 }