Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualBuckeye

Posted 15 August 2014 - 10:02 AM

First: take unbird's advice. The sequence you posted could (and probably does) have several errors.

 

1. Is the format of frame1 the same as the backbuffer?

 

 

 


SetRect(&r1, GetHeight()/4, 0, GetWidth(), ((GetHeight()*3)/4)-1);

 

2. The rectangle you specify looks strange - you set the rect left x value to the GetHeight()/4, and set the right x to GetWidth()?? If GetWidth() is the width of the backbuffer, that makes the width of the surface greater than the width of the backbuffer.

 

EDIT: Review this article. In particular:

 

       The source surface must have been created with D3DPOOL_SYSTEMMEM. (i.e., in your case, both surfaces)
        The destination surface must have been created with D3DPOOL_DEFAULT. (i.e., in your case, both surfaces)
        The source and dest rects must fit within the surface.
        The source format must match the dest format.

 

 

 

I haven't worked in DX9 for a while, but I think you're going to have to try GetRenderTargetData to start with, to get the backbuffer (video memory) into system memory. Then go from there, possibly with StretchRect, likely needing 2 or 3 surfaces overall.


#2Buckeye

Posted 15 August 2014 - 09:37 AM

First: take unbird's advice. The sequence you posted could (and probably does) have several errors.

 

1. Is the format of frame1 the same as the backbuffer?

 


SetRect(&r1, GetHeight()/4, 0, GetWidth(), ((GetHeight()*3)/4)-1);

 

2. The rectangle you specify looks strange - you set the rect left x value to the GetHeight()/4, and set the right x to GetWidth()?? If GetWidth() is the width of the backbuffer, that makes the width of the surface greater than the width of the backbuffer.


#1Buckeye

Posted 15 August 2014 - 09:36 AM

First: take unbird's advice. The sequence you posted could (and probably does) have several errors.

 

1. Is the format of frame1 the same as the backbuffer?

2. The rectangle you specify looks strange - you set the rect left x value to the GetHeight()/4, and set the right x to GetWidth()?? If GetWidth() is the width of the backbuffer, that makes the width of the surface greater than the width of the backbuffer.


PARTNERS