(C++) Noesis and Multiple Windows with GLFW, how to?
Posted: 14 Jun 2017, 16:40
I created new window in GLFW and want add new IView in to it. I create new IView and load another xaml, and add same VGContext. But when new window is created and I start render with Noesis, program crash. I think it because GLFW use MakeCurrentContext(window) what makes a problem when I change CurrentContext. How can I create and use Noesis with multiple windows?
Code: Select all
glfwMakeContextCurrent(window); // This must be befor creating Noesis VGContext. If this is not before Noesis::VGContext, program crash.
// Noesis Initialization
Ptr<FrameworkElement> xaml = Noesis::GUI::LoadXaml<FrameworkElement>("my.xaml");
Ptr<FrameworkElement> xamlElementChooseWin = Noesis::GUI::LoadXaml<FrameworkElement>("choicer.xaml");
xamlView = Noesis::GUI::CreateView(xaml.GetPtr());
xamlView->SetAntialiasingMode(Noesis::Gui::AntialiasingMode_MSAA);
xamlViewChoicer = Noesis::GUI::CreateView(xamlElementChooseWin.GetPtr());
xamlViewChoicer->SetAntialiasingMode(Noesis::Gui::AntialiasingMode_MSAA);
Ptr<GLRenderDevice> device = *new GLRenderDevice();
VGOptions options;
Ptr<VGContext> context = Noesis::GUI::CreateVGContext(device.GetPtr(), Noesis::VGOptions());
xamlView->GetRenderer()->Init(context.GetPtr());
xamlViewChoicer->GetRenderer()->Init(context.GetPtr());