locked
DirectX: HResult 0x887a0001 when assigning DirtyRects to swapchain1

    Question

  • Hi,

    Question 1:

    I'm trying to specify a Dirty Rectangle on my swapChain to avoid the entire frame to be redrawn.  I use the DXGI_PRESENT_PARAMETERS struct right before I present the Frame. Here is my code so far:

    DXGI_PRESENT_PARAMETERS parameters = {0};
        parameters.DirtyRectsCount = 1;
        parameters.pDirtyRects = rcts;
        parameters.pScrollRect = nullptr;
        parameters.pScrollOffset = nullptr;
    
    HRESULT hr = m_swapChain->Present1(1, 0, &parameters);

    All I'm getting is  HResult = 0x887a0001. I believe somthing in my parameters struct is wrong. 

    How can I fix this error?

    Question 2:

    In general my app is going to draw a line along the finger motion on the screen. every Recognized point is connected via the m_d2dContext->DrawLine method. The problem here is, that after a while I have several hundret points to connect and this is very time consuming. Only the area around the finger is changing so I figured the use of DirtyRects would be a good approch. Are there any alternetives or different solutions?

    Thanks in Advance

    Friday, March 1, 2013 1:27 PM

Answers

  • bottom is not greater than top...

    Monday, March 4, 2013 9:36 PM
  • Just to add to what Chuck said, a RECT isn't {x,y,width,height}. If that's what you intended, you would have RECT{ left = 100, top = 50, right = 400, bottom = 60 } as your values.

    XNA/DirectX MVP | Website | Blog | @mikebmcl

    Tuesday, March 5, 2013 1:00 AM

All replies

  • HResult = 0x887a0001 ->  DXGI_ERROR_INVALID_CALL

    On Windows 8 with a DEBUG device, you should get some additional diagnostic output from DXGI in your debug window.

    Friday, March 1, 2013 7:25 PM
  • I get the following Error:

    DXGI ERROR: IDXGISwapChain::Present: The dirty rect #0 passed to Present is empty. DirtyRect = RECT{ left = 100, top = 50, right = 300, bottom = 10 } [ MISCELLANEOUS ERROR #112: ]

    The RECT is initialized correctly so I don't get this message.

    Monday, March 4, 2013 10:04 AM
  • bottom is not greater than top...

    Monday, March 4, 2013 9:36 PM
  • Just to add to what Chuck said, a RECT isn't {x,y,width,height}. If that's what you intended, you would have RECT{ left = 100, top = 50, right = 400, bottom = 60 } as your values.

    XNA/DirectX MVP | Website | Blog | @mikebmcl

    Tuesday, March 5, 2013 1:00 AM
  • Alright that fixed my Problem. Thanks.

    Is there anything you can tell me about my second question? Are there ways to avoid redrawing the entire screen? Because the only area changing is the area my finger touches the screen. It qould be a waste to redraw the entire frame when there isn't much change...

    Wednesday, March 6, 2013 9:57 AM