void resourceWindow_CreateInternalResources(OSWindow window, InternalResourceType resourceType) { if ((resourceType & InternalResourceType.Sound) == InternalResourceType.Sound) { openALManager.resumeAudio(); } }
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]; }
/// <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; }
private void MainWindow_DestroyInternalResources(OSWindow window, InternalResourceType resourceType) { if ((resourceType & InternalResourceType.LargeReloadableResources) == InternalResourceType.LargeReloadableResources) { virtualTextureManager.suspend(); } }
private void MainWindow_CreateInternalResources(OSWindow window, InternalResourceType resourceType) { if ((resourceType & InternalResourceType.LargeReloadableResources) == InternalResourceType.LargeReloadableResources) { virtualTextureManager.resume(); } }
void resourceWindow_DestroyInternalResources(OSWindow window, InternalResourceType resourceType) { if ((resourceType & InternalResourceType.Sound) == InternalResourceType.Sound) { openALManager.suspendAudio(); } }
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(); }
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; }
/// <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; }
public void changeOSWindow(OSWindow newWindow) { if (window != null) { window.Resized -= resized; } this.window = newWindow; window.Resized += resized; resized(window); }
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); } }
/// <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; } }
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); }
void mainWindow_Closed(OSWindow window) { shutdown(); }
public RendererWindow createRendererWindow(OSWindow embedWindow, String name) { WindowInfo windowInfo = new WindowInfo(embedWindow, name); return(createRendererWindow(windowInfo)); }
void mainWindow_Closed(OSWindow window) { exit(); }
void mainWindow_Closed(OSWindow sender) { exit(); }
public GUIManager(MDILayoutManager mdiManager, OSWindow window) { this.mdiManager = mdiManager; this.window = window; }
public void windowChanged(OSWindow newWindow) { screenLayoutManager.changeOSWindow(newWindow); }
private void OSWindow_Resized(OSWindow window) { renderListener.resized(); }
void window_Resized(OSWindow window) { fireSizeChanged(window.WindowWidth, window.WindowHeight); }
void osWindow_Closing(OSWindow window) { renderWindow.setActive(false); }
void osWindow_Resized(OSWindow window) { renderWindow.windowMovedOrResized(); }
public ScreenLayoutManager(OSWindow window) { this.window = window; window.Resized += resized; }
public void createGUI(MDILayoutManager mdiManager, LayoutChain layoutChain, OSWindow window) { doCreateGui(mdiManager, layoutChain, window); }
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); }
void window_Deactivated(OSWindow window) { fireReleaseAllKeys(); }
void window_Resized(OSWindow window) { resized(); }