Page 1 of 1

Lockup

Posted: 07 Sep 2017, 15:04
by schragnasher
Iv been able to incorporate and render Noesis in my game, but im running into a funny issue. Many of the controls work ok, such as buttons. But when i try to use things like the combobox or expander, after i click them my app will seize up. Any idea what might be happening here?

Re: Lockup

Posted: 08 Sep 2017, 04:44
by schragnasher
Ok its still rendering, and updating, just has gone black...im assuming its more GL state issues i need to reset.

Re: Lockup

Posted: 08 Sep 2017, 04:50
by jsantos
I am almost sure that this is happening because you are not properly rendering the offscreen phase in your integration code. The offscreen phase is where we generate render textures, in that phase we change the active render target and also the viewport dimensions. It is very important that you restore at least those states before you start rendering to the screen.
void Render(void)
{
    view->Update(time);
    
    view->GetRenderer()->UpdateRenderTree();
    view->GetRenderer()->RenderOffscreen();
    
    // Restore state. This must be done per frame because NoesisGUI modifies the GPU state
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
    glClearColor(0.0f, 0.0f, 0.25f, 0.0f);
    glClearStencil(0);
    glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    glViewport(0, 0, g_Width, g_Height);
    
    // Renders UI to active render target in the active viewport
    view->GetRenderer()->Render();
}

Re: Lockup

Posted: 08 Sep 2017, 04:51
by jsantos
Sorry, but it is not your fault. If you followed the GL integration sample, we are not restoring the default framebuffer there. I am fixing that example right now...

Re: Lockup

Posted: 08 Sep 2017, 04:56
by schragnasher
I see it here http://www.noesisengine.com/docs/Gui.Co ... tml#opengl I just overlooked it.

Re: Lockup

Posted: 08 Sep 2017, 05:02
by jsantos
Yes, talking about the example included inside the C++ SDK. That example you mention is part of the obsolete documentation that is still using the 1.2 API...