void AddViewButton_Click(object sender, RoutedEventArgs e) { if (windowIndex >= 4 || SimulationApplication.Instance.getisRun() == true) { return; } // GL Rendering을 위한 새로운 window 창 생성 GLDrawWindow newWindow = new GLDrawWindow(windowIndex); WindowItem item = new WindowItem(); newWindow.Title = "Window_" + windowIndex; item.Title = "Window_" + windowIndex; item.Index = windowIndex; item.window = newWindow; list_ViewWindow.Add(item); newWindow.Left = this.Left + this.ActualWidth + (newWindow.Width * ((list_ViewWindow.Count - 1) % 3)); newWindow.Top = this.Top + (newWindow.Height * ((list_ViewWindow.Count - 1) / 3)); newWindow.Show(); // 새로 생긴 창을 Show 해줘야 Handle이 할당됨 // Subsystem 생성 EGLSubsystem eglSubsystem = SimulationApplication.Instance.getApp().AddSubsystem <EGLSubsystem>(); EGLSwapBuffersSubsystem eglSwapBuffersSubsystem = SimulationApplication.Instance.getApp().AddSubsystem <EGLSwapBuffersSubsystem>(); // eglSubsystem에 windowIndex 주입 eglSubsystem.TargetDisplay = windowIndex; // View 구성 View temView = SimulationApplication.Instance.getApp().AddView <View>(); temView.AddSubsystem(eglSubsystem); temView.AddSubsystem(renderSubsystem); temView.AddSubsystem(eglSwapBuffersSubsystem); temView.SetOrder(eglSubsystem, 1); temView.SetOrder(renderSubsystem, 2); temView.SetOrder(eglSwapBuffersSubsystem, 3); windowIndex++; }
void AddView() { if (windowIndex >= 8 || SimulationApplication.Instance.getisRun() == true) { return; } GLDrawWindow newWindow = new GLDrawWindow(windowIndex); WindowItem item = new WindowItem(); newWindow.Title = "Window_" + windowIndex; item.Title = "Window_" + windowIndex; item.Index = windowIndex; item.window = newWindow; list_ViewWindow.Add(item); newWindow.Left = this.Left + this.ActualWidth + (newWindow.Width * ((list_ViewWindow.Count - 1) % 3)); newWindow.Top = this.Top + (newWindow.Height * ((list_ViewWindow.Count - 1) / 3)); newWindow.Show(); View temView = SimulationApplication.Instance.getApp().AddView <View>(); EGLSubsystem eglSubsystem = SimulationApplication.Instance.getApp().AddSubsystem <EGLSubsystem>(); EGLSwapBuffersSubsystem eglSwapBuffersSubsystem = SimulationApplication.Instance.getApp().AddSubsystem <EGLSwapBuffersSubsystem>(); // eglSubsystem에 windowIndex 주입 eglSubsystem.TargetDisplay = windowIndex; temView.AddSubsystem(eglSubsystem); temView.AddSubsystem(renderSubsystem); temView.AddSubsystem(eglSwapBuffersSubsystem); temView.SetOrder(eglSubsystem, 1); temView.SetOrder(renderSubsystem, 2); temView.SetOrder(eglSwapBuffersSubsystem, 3); windowIndex++; }