Page 1 of 1

OpenGL restore state after xamlRenderer->Render()

Posted: 03 Dec 2015, 13:58
by lavrovd
Hi there,

I am evaluating NsGUI at the moment for video application plugin GUI. The plugin runs inside the host application and I am given OpenGL 2.0 context to draw my HUD to. I've got NsGUI up on the screen fairly easy but it seems to mess up GL state that when I switch off HUD host's OpenGL context is damaged.

Does NsGUI preserve OpenGL state after the rendering? Do I need to set up specific flags to force it do so? What state if affected by NsGUI Render()?

Many thanks,
Dmitry Lavrov

Re: OpenGL restore state after xamlRenderer->Render()

Posted: 03 Dec 2015, 15:40
by jsantos
We do not preserve the GPU state because it is not efficient doing that at our side (we need to invoke get* functions). But this have been requested so many times that we are considering adding it to v1.3, probably as an optional flag or something similar.

Meanwhile, here you can find the GL state restorer being used in the Leadwerk integration:

https://github.com/FourthQuarter/Noesis ... LState.cpp

Thanks!

Re: OpenGL restore state after xamlRenderer->Render()

Posted: 04 Dec 2015, 14:42
by lavrovd
Ok that works! Thank you very much.

Dmitry

Re: OpenGL restore state after xamlRenderer->Render()

Posted: 04 Dec 2015, 14:45
by jsantos
Good! : )