Is a second window possible on Linux with C#?
Posted: 19 Mar 2018, 19:39
I've searched the forum and the code samples for a second window/dialog window solution but all i found are tips how to fade-out the current view/render tree and fade-in a new render tree (e. g. the discussion "Simulating modal dialog inside a view"). The fade-out/fade-in approach is good for a full screen presentation. But for a window-based presentation this solution looks strange.
What i'm looking for is a solution with a second window. I have already managed to create, display and close a second GL window, that doesn't disturb or crash the main window. But as soon as i connect the OnPreRender() or OnPostRender() event handler, the application crashes.
What i'm looking for is a solution with a second window. I have already managed to create, display and close a second GL window, that doesn't disturb or crash the main window. But as soon as i connect the OnPreRender() or OnPostRender() event handler, the application crashes.
For me it looks like a renderer confusion. I can not figure out how each renderer determines it's own OpenGL window and connects to it. This is how i create the renderer for the first and second window (every window has it's own class and consequently it's own member attributes _view and _renderer):at <unknown> <0xffffffff>
at (wrapper managed-to-native) Noesis.Renderer.Noesis_Renderer_NeedsOffscreen (System.Runtime.InteropServices.HandleRef) <IL 0x0001a, 0xffffffff>
at Noesis.Renderer.Noesis_Renderer_NeedsOffscreen_ (System.Runtime.InteropServices.HandleRef) <IL 0x00001, 0x00063>
at Noesis.Renderer.NeedsOffscreen () <IL 0x00006, 0x0005b>
at IntegrationSample.DialogWindow.OnPreRender () [0x00013] in /home/rupert/Projects/NoesisGUI/NoesisGUI-IntegrationSample/MainWindow.cs:469
at Noesis.GLUTWrapper.OnPreRender () [0x00010] in /home/rupert/Projects/NoesisGUI/NoesisGUI-IntegrationSample/GLUTWrapper.cs:153
at Noesis.libGLUTWrapper.GLUT_Display () [0x00042] in /home/rupert/Projects/NoesisGUI/NoesisGUI-IntegrationSample/libGLUTWrapper.cs:322
at (wrapper native-to-managed) Noesis.libGLUTWrapper.GLUT_Display () <IL 0x0002f, 0xffffffff>
at <unknown> <0xffffffff>
at (wrapper managed-to-native) Noesis.GLUT.MainLoop () <IL 0x0000e, 0xffffffff>
at Noesis.libGLUTWrapper.GLUT_Run () [0x0009a] in /home/rupert/Projects/NoesisGUI/NoesisGUI-IntegrationSample/libGLUTWrapper.cs:517
at Noesis.GLUTWrapper.Run () [0x00015] in /home/rupert/Projects/NoesisGUI/NoesisGUI-IntegrationSample/GLUTWrapper.cs:291
at IntegrationSample.MainWindow.Run () [0x0018a] in /home/rupert/Projects/NoesisGUI/NoesisGUI-IntegrationSample/MainWindow.cs:269
at IntegrationSample.MainWindow.Main (string[]) [0x001c4] in /home/rupert/Projects/NoesisGUI/NoesisGUI-IntegrationSample/MainWindow.cs:189
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00058, 0xffffffff>
private void Run()
{
....
var content = (Noesis.Grid)Noesis.GUI.LoadXaml("TextBox.xaml");
_view = Noesis.GUI.CreateView(content);
_renderer = _view.Renderer;
_renderer.InitGL(new Noesis.VGOptions());
...
}
Any ideas? Thanks in advance!private void Run()
{
...
var content = (Noesis.Grid)Noesis.GUI.LoadXaml("SampleGUI.xaml");
_view = Noesis.GUI.CreateView(content);
_renderer = _view.Renderer;
_renderer.InitGL(new Noesis.VGOptions());
...
}