subdivided rendering on swapchainbackgroundpanel RRS feed

  • Question

  • Hi,

    I'm currently developing a Direct2D+Xaml app using swapchainbackgroundpanel. The drawing-operations take too long to perform them at a time. So I want to render content, present the backbuffer and then render further content on top of that content, then present it again and so on. So you could describe it as a subdivided rendering with interim presentation. Which is the best solution to do so? Maybe rendering to a bitmap and copy the content to the backbuffer each time?

    Any suggestions would be helpful! Thanks.
    Tuesday, June 4, 2013 4:26 PM

All replies

  • Maybe I've found a solution! Each Windows-Store-app has to use DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL as the swap-effect. So i could specify a scroll-rect with the size of the swapchainbuffers and without offset, so the buffer gets copied among presentation and rendering. Is there any tutorial how to do that, because http://msdn.microsoft.com/en-us/library/windows/desktop/hh706345(v=vs.85).aspx doesn't show c++-syntax. This gives an error:

    	DXGI_PRESENT_PARAMETERS parameters = {0};
    	parameters.DirtyRectsCount = 0;
    	parameters.pDirtyRects = nullptr;
    	RECT scrollRect;
    	scrollRect.left = 0.0f;
    	scrollRect.top = 0.0f;
    	scrollRect.right = m_windowBounds.Width;
    	scrollRect.bottom = m_windowBounds.Height;
    	parameters.pScrollRect = &scrollRect;
    	POINT rectOffset;
    	rectOffset.x = 0.0f;
    	rectOffset.y = 0.0f;
    	parameters.pScrollOffset = &rectOffset;
    	HRESULT hr = m_swapChain->Present1(1, 0, &parameters);

    Monday, June 10, 2013 3:52 PM