schragnasher
Topic Author
Posts: 33
Joined: 07 Mar 2015, 01:58

Shifting GUI after resolution change

08 Oct 2017, 04:38

I cant seem to diagnose an issue i am having. Whenever i change the size of my window i get a weird artifact when resizing back to the original size. Gif below shows what i am seeing. I call SetSize on my view each time i change the window size, but that does not seem to help.

https://imgur.com/a/nwbnd
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Shifting GUI after resolution change

09 Oct 2017, 18:34

This is a custom integration right? Are you restoring the framebuffer and viewport after the offscreen phase? This must be done per frame.
 
schragnasher
Topic Author
Posts: 33
Joined: 07 Mar 2015, 01:58

Re: Shifting GUI after resolution change

10 Oct 2017, 02:59

Like this? Doesn't change anything. This only happens after i change the window size to be smalller. So its starts ok, and its fine if i make the window larger, but if i ever make it smaller it starts shifting.

if (view.Renderer.NeedsOffscreen())
{
view.Renderer.RenderOffscreen();

view.SetSize(_gameWindow.Width, _gameWindow.Height);

GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
}
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Shifting GUI after resolution change

10 Oct 2017, 17:42

This
GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
must be done before the normal render pass (IRenderer::Render). You also need to adjust the viewport (glViewport) because the offscreen may modify it.
 
schragnasher
Topic Author
Posts: 33
Joined: 07 Mar 2015, 01:58

Re: Shifting GUI after resolution change

12 Oct 2017, 03:09

I figured it out. Got it all working, thanks much!
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Shifting GUI after resolution change

18 Oct 2017, 04:08

Thanks for the feedback! Closing this.

Who is online

Users browsing this forum: Google [Bot] and 3 guests