View Issue Details

IDProjectCategoryView StatusLast Update
0001801NoesisGUIC++ SDKpublic2020-10-14 14:55
ReporterRoest Assigned Tosfernandez  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version3.0.6 
Target Version3.0.7Fixed in Version3.0.7 
Summary0001801: GUI stretching/shrinking when mouse over certain gui elements after window resize
DescriptionAfter resizing the window the UI shows a weird resizing effect with some gui elements.

Steps To ReproduceDon't have a minimal example for that. The game is free on Steam so it's possible to see there. Steps are visible in this example video [url]https://gfycat.com/snivelingbelovedflea[/url]

You can see for yourself on [url]https://store.steampowered.com/app/709240/Ingnomia/[/url] and the code would be on [url]https://github.com/rschurade/Ingnomia[/url]
TagsC++
PlatformAny

Activities

sfernandez

sfernandez

2020-10-14 12:18

manager   ~0006665

Looking at the video it seems related to the drawing of offscreen textures because during that phase we change the active render target and viewport.
Do you restore main render target's Viewport after calling Noesis renderer->RenderOffscreen() and before calling renderer->Render()?
Roest

Roest

2020-10-14 12:50

reporter   ~0006666

I'd say yes. The relevant code is here: https://github.com/rschurade/Ingnomia/blob/master/src/gui/mainwindow.cpp#L561
sfernandez

sfernandez

2020-10-14 13:34

manager   ~0006667

Looking at the code, renderer->paintWorld() is not calling glViewport, and I don't see that QOpenGLWindow::makeCurrent calling it either: https://code.woboq.org/qt5/qtbase/src/gui/kernel/qopenglwindow.cpp.html#_ZN13QOpenGLWindow11makeCurrentEv
Could you do a quick test and always call glViewport (with the appropriate sizes) before renderer->paintWorld()?
Roest

Roest

2020-10-14 13:41

reporter   ~0006668

That seems to fix it.
sfernandez

sfernandez

2020-10-14 13:49

manager   ~0006669

Last edited: 2020-10-14 13:50

Great, so that was the missing piece. It should be enough to call it after makeCurrent:

if ( m_view->GetRenderer()->RenderOffscreen() )
{
    // Restore state managed by QOpenGLWindow
    makeCurrent();
    glViewport(...);
}

Could you confirm it?

Roest

Roest

2020-10-14 13:59

reporter   ~0006670

Well I have to call it at the beginning of paintWorld() but that basically the same location in execution order. So this could be closed. Thanks

Issue History

Date Modified Username Field Change
2020-09-28 17:15 Roest New Issue
2020-09-28 17:15 Roest Tag Attached: C++
2020-10-14 11:21 jsantos Assigned To => sfernandez
2020-10-14 11:21 jsantos Status new => assigned
2020-10-14 11:21 jsantos Target Version => 3.0.7
2020-10-14 12:18 sfernandez Status assigned => feedback
2020-10-14 12:18 sfernandez Note Added: 0006665
2020-10-14 12:50 Roest Note Added: 0006666
2020-10-14 12:50 Roest Status feedback => assigned
2020-10-14 13:34 sfernandez Status assigned => feedback
2020-10-14 13:34 sfernandez Note Added: 0006667
2020-10-14 13:41 Roest Note Added: 0006668
2020-10-14 13:41 Roest Status feedback => assigned
2020-10-14 13:49 sfernandez Status assigned => feedback
2020-10-14 13:49 sfernandez Note Added: 0006669
2020-10-14 13:50 sfernandez Note Edited: 0006669
2020-10-14 13:59 Roest Note Added: 0006670
2020-10-14 13:59 Roest Status feedback => assigned
2020-10-14 14:55 sfernandez Status assigned => resolved
2020-10-14 14:55 sfernandez Resolution open => no change required
2020-10-14 14:55 sfernandez Fixed in Version => 3.0.7