This project is read-only.


May 30, 2013 at 1:53 AM
When switching to full-screen with Alt+Enter, the demo applications show a warning in the output window:

DXGI WARNING: IDXGISwapChain::Present: Fullscreen presentation inefficiencies incurred due to application not using IDXGISwapChain::ResizeBuffers appropriately, specifying a DXGI_MODE_DESC not available in IDXGIOutput::GetDisplayModeList, or not using DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH.DXGI_SWAP_CHAIN_DESC::BufferDesc = { 640, 480, { 60, 1 }, R8G8B8A8_UNORM_SRGB, 0, 0 }; DXGI_SWAP_CHAIN_DESC::SampleDesc = { 1, 0 }; DXGI_SWAP_CHAIN_DESC::Flags = 0; [ MISCELLANEOUS WARNING #98: ]

I can see that the output is simply scaled instead of sized to the screen.
Is this a known issue?

Thank you.
May 30, 2013 at 11:51 AM
I have indeed seen this error/warning before, but I don't know how to get rid of it. It has been a little while, but I recall trying to correct this before and I wasn't able to figure out what was causing the issue.

Do you have any ideas or experience with this in the past?
May 30, 2013 at 9:09 PM
I do have experience with this. The rudimentary engine I was working on before I discovered Hieroglyph managed to do this without error.
I will have a go at fixing this in H3. I'm still exploring the complexities of the engine so I might have to ask a question or two along the way. If I manage to sort it out I'll post the solution as a patch.

Michael Stone
May 30, 2013 at 10:56 PM
OK, I've found the problem.
Some of the sample applications are derived from Application.
Some are derived from RenderApplication.

After DXGI intercepts Alt+Enter it automatically resizes the front buffers and then sends the application a WM_SIZE message. The app is supposed to resize the render targets in this handler before the next call to Present().

RenderApplication automatically handles the WM_SIZE message and calls ResizeTargets. Application does not because it doesn't have an embedded object with an HWND.

This is why the "SpinningCube" demo shows the problem but the "SkinAndBones" one does not.

Could you explain why there are these two Application classes? Do they simply represent an evolution in the engine design with RenderApplication being a later iteration?

Thank you,
Michael Stone
May 31, 2013 at 12:36 PM
Thanks for checking into this. I also tried to reproduce the issue yesterday, and couldn't get it to happen - and you already figured out why. I was using the samples based on RenderApplication. The idea behind RenderApplication was to build the basic application framework that would use provide a single render window for output, and have a scene, camera, and the initialization all taken care of for you.

This covers 95% of the use cases for the engine, but there are still others out there. For example, if you want to use more than one window, or have multiple scenes, etc... So that option is open to people if they want to derive from Application and provide their own 'stuff' to use during the runtime of the application. This allows for more uses than gaming and leaves some flexibility.

The samples that use Application are typically the ones that fall into that last 5% (i.e. ViewFromTheWindow), or are the very basic samples. These started out before there was a RenderApplication (so you are right about the evolution of the engine) and were intended to show how the very basics of the engine worked. Thus I didn't update them over time, since the RenderApplication was hiding lots of the work that needs to be done to get a device up and running.

In hind sight, it would probably be better to update all of the samples, but that would also take some time to get working too. Do you see this as a big problem, or more of a minor hindrance?
May 31, 2013 at 9:24 PM
With this explanation I don't see it as a problem at all.

Thanks for taking the time to explain things to me.

Michael Stone
Jun 1, 2013 at 12:37 AM
Great - thanks for the discussion. I don't mind explaining these types of topics, and in fact I really enjoy discussing some of the design aspects of the engine, so if you have any questions, keep them coming ;)