lavrovd
Topic Author
Posts: 2
Joined: 28 Nov 2015, 10:20

OpenGL restore state after xamlRenderer->Render()

03 Dec 2015, 13:58

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
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

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

03 Dec 2015, 15:40

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!
 
lavrovd
Topic Author
Posts: 2
Joined: 28 Nov 2015, 10:20

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

04 Dec 2015, 14:42

Ok that works! Thank you very much.

Dmitry
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

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

04 Dec 2015, 14:45

Good! : )

Who is online

Users browsing this forum: No registered users and 2 guests