CopyRects()

Started by
11 comments, last by programmer_tom 19 years ago
having issues converting a part of a program from dx8 to dx9. used to use copyrects() in a few places. have switched to using GetRenderTargetData() where the two surfaces were the same size, but there's a place where i want to copy just a small section of the back buffer into a tiny texture (copyrects() used to do allow this, but now you have to have surfaces of the same size). anyone know how do surface copy with rectangular area in dx9?
Advertisement
StretchRect?
Stay Casual,KenDrunken Hyena
thanks DH, but it's my understanding stretchrect() has tons of restrictions, and won't work on most older cards. i'm kinda bummed out they took copyrects() away :( i'll keep lookin around....there's probably another function that does what i need to do.
StretchRect() is still the way to go IMO. The restrictions are mainly to do with format conversions.

A size reducing StretchRect() from a Render Target (e.g. your back buffer) to a Render Target Texture (e.g. your small texture) is supported in all cases if the formats are the same and you leave the filtering up to the driver.

UpdateSurface() and StretchRect() form the replacement for CopyRects(), the functionality hasn't disappeared, it's just the restrictions on copying imposed by various graphics chips have been made more explicit.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

thanks for the reply S1CA.

i figured that i could just render to texture (duh).
apparently, i didn't know how to do this 6 mos ago when i wrote
the copyrects() code, and when we went to dx9 the other day, it
never crosssed my mind until now. much easier/better/faster solution too.

btw...i guess robert dunlop isn't the only microsoft dx mvp :)
i thought i read somewhere he was.

-programmer_tom


Quote:Original post by programmer_tom
btw...i guess robert dunlop isn't the only microsoft dx mvp :)
i thought i read somewhere he was.


I think there are somewhere around 20 DirectX MVPs at the moment. 4 or so hang out on GameDev.net. I'm just too lazy to edit my .sig.
Stay Casual,KenDrunken Hyena
well, they should call it a VP ( Valuable professional ) or a VVP ( Very Valuable professional ) then, because 20 most valueable professionals doesn't make a lot of sense :)
Quote:Original post by programmer_tom
well, they should call it a VP ( Valuable professional ) or a VVP ( Very Valuable professional ) then, because 20 most valueable professionals doesn't make a lot of sense :)

Well, considering the number of DirectX programmers worldwide participating in *all* online communities, 20 is a very small number (though they're less than 20, IIRC).

The public list seems to only show members with public profiles and pictures, so I don't even show up. :( I could add a picture, but that might qualify as cruel and unusual punishment.

You can go here to see Circlesoft and Simon:
https://mvp.support.microsoft.com/communities/mvplist.aspx?Product=Windows+-+DirectX
Stay Casual,KenDrunken Hyena
The public list seems to only show members with public profiles and pictures, so I don't even show up.

ok, ok i believe you. jk. so you have to work for Microsoft i suppose to become a MVP? i wouldn't have thought u were a MS guy from your tutorials.

I could add a picture, but that might qualify as cruel and unusual punishment.
haha.




This topic is closed to new replies.

Advertisement