Page 1 of 1

ComboBox - GL Render Blink/Freeze

Posted: 10 Jan 2022, 17:22
by jack.barkov
Hi!

I'm trying to implement a simple example with NoesisGUI.
But I have a little bug that I can't fix.

I made a small example for the noesis team to be able to reproduce the bug.

I'm using glfw 3.2.1, glew 2.1.0, glm and noesisgui 3.1.2 for the example (but I tested it with 3.0.9 and the same bug happened).

Link to source code (and release binaries for simple checks):
https://drive.google.com/file/d/19gMZmBJ-T8PP59yZwyMMuyTQr6taPDjx/view
I also made a little video showing what's going on:


Notice that the triangle starts to blink or lock indefinitely when you interact with the ComboBox.

I haven't figured out how I can fix this.
Is it a bug in my code?

Thanks.
Jack.

Re: ComboBox - GL Render Blink/Freeze

Posted: 10 Jan 2022, 17:25
by jack.barkov
I believe it is something related to this topic?

viewtopic.php?f=3&t=2489

Re: ComboBox - GL Render Blink/Freeze

Posted: 10 Jan 2022, 17:34
by jack.barkov
I've already managed to make this same bug using a Label with a content larger than the element's area.

Test with this code:
	Noesis::Ptr<Noesis::Grid> xaml(Noesis::GUI::ParseXaml<Noesis::Grid>(R"(
    <Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
        <Grid Width="1024" Height="768">
			<Grid.RowDefinitions>
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Width="15" Height="20" Content="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" />
        </Grid>
    </Grid>
)"));
Video:

Re: ComboBox - GL Render Blink/Freeze

Posted: 10 Jan 2022, 18:20
by jsantos
This is an integration issue with the offscreen phase.

Make sure you are rendering the offscreen before binding the main buffer. And also make sure to restore GL state, any call to RenderOffscreen or Render will modify it. For example, RenderOffscreen sometimes changes the active framebuffer (I think this is what is happening in your case).

https://github.com/Noesis/Tutorials/blo ... n.cpp#L115

This is explained in the render part of the Integration Guide.

Re: ComboBox - GL Render Blink/Freeze

Posted: 11 Jan 2022, 14:49
by jack.barkov
Solved!

Thank you.
Jack.

Re: ComboBox - GL Render Blink/Freeze

Posted: 11 Jan 2022, 16:22
by jsantos
Great! Marking as solved