1

All I want is to make a simple application that you can resize while rendering. (IE resize while never once seeing the buffer out the edge of the screen)

Most commercial, professional, and major open source programs seem to be capable of this, while most all personal or hobbyist programs never seem to be capable of this. (I have no idea why)

I want to make a professional looking program like that.


A few examples of what I'm talking about:


What I have used in the past for windowing are:

  • SDL (Currently)
  • SFML
  • GLFW +OpenGL

And this problem applies to all 3 from what I can recall.


I would like to know the following:

  1. If this is a problem that is solvable, please tell me why or why not I've never once looked that low-level (OS APIs nor Graphics back-ends) so I just want to know why.

  2. What's the way to solve this? Is it within my means?

  3. Is the solution -really- a perfect solution? I've seen many people suggest solutions that have various problems (IE minimizing the buffer but not getting rid of it entirely OR you got rid of it but there's a ton of flickering (I forgot why but it doesn't matter))

My current understanding is that this a Win32 API/Windows API related bug related to blocking. I don't have any deeper understanding or knowledge on how to create my own solution easily, but if I must learn then I will.

  • Register your window using the `CS_HREDRAW` and `CS_VREDRAW` [window class styles](https://msdn.microsoft.com/en-us/library/windows/desktop/ff729176.aspx). Applications that stop rendering during a resize operation usually do so on purpose, to provide a smooth resizing experience. Particularly when using a graphics library like DirectX or OpenGL, resizing is a costly operation, requiring you to tear down the entire render system, and reinitialize it to account for the change in viewport dimensions. – IInspectable Jun 13 '18 at 07:39
  • You'll find lots of useful information to understand how the system works in [this answer](https://stackoverflow.com/a/18043461/1889329). In a nutshell, this is not a bug. The system is working as designed. – IInspectable Jun 13 '18 at 07:43
  • Do you mean "seeing buffer not matching window" by *"seeing the buffer out the edge of the screen"*? Also though handling window resize is indeed a rather costly operation it does not require you to tear down the entire render system. Typically it only requires resizing of window-size dependent resources (such as swap chain buffers), viewport(s) update and recalculation of window-size dependent content size / position (UI adjustment for example). – user7860670 Jun 13 '18 at 10:17
  • @IInspectable CS_HREDRAW | CS_VREDRAW might be the answer I'm looking for but I am inable to test it because I don't know winAPI myself. I would have to study winAPI from the very start to write a program to test if that works. I have _a winAPI (+SDL2) program_ but since it's not mine I don't know how to alter it: [link](https://ghostbin.com/paste/74dzh) I tried changing the line: `wc.style = 0;` to `wc.style = CS_HREDRAW | CS_VREDRAW;` And I can't tell if it fixes the problem or not since it results in a lot of flickering. Might not be a bug, but it's undesired. – ADisplayName Jun 13 '18 at 16:25
  • @VTT "seeing buffer not matching window" by "seeing the buffer out the edge of the screen"? I don't know what you mean by this? I shouldn't see the buffer at all correct?Maybe "buffer" isn't the right term, but I believe it is. If the "buffer" is black, and I'm drawing cornflower blue atop it, I should realistically never see black correct? Yet, when I resize the edge, I see black for a small period of time (or white/whatever color the buffer is) Everything else said is mostly over my head. – ADisplayName Jun 13 '18 at 16:28
  • When I say (I see black for a small period of time) I mean, if I resize outwards (expanding the window) I see the buffer in the expanded space, up until I let go of the edge (when it starts rendering again). – ADisplayName Jun 13 '18 at 16:40

0 Answers0