I have a D3DPOOL_DEFAULT type surface and I want to convert it into a D3DPOOL_SYSTEMMEM. I know UpdateSurface does the opposite.
Asked
Active
Viewed 682 times
2
-
If you have read access to the Default Pool surface, you can lock both surfaces and copy the values. http://msdn.microsoft.com/en-us/library/windows/desktop/bb172231(v=vs.85).aspx. – Nico Schertler Nov 24 '12 at 17:24
-
Thanks, I am new to DX. But I don't quite understand the pitch in the struct returned by LockRect[link](http://msdn.microsoft.com/en-us/library/windows/desktop/bb172570(v=vs.85).aspx). Is it the size of the buffer (Heights * pitch)? So I can complete the conversion with memcpy? – LeOpArD Nov 24 '12 at 18:16
-
pitch is the byte size of one row. It is sometimes referred to as stride and is used to declare padding at the end of a row. The first row then has address `pBits`, the second `pBits + Pitch` and so on. – Nico Schertler Nov 24 '12 at 18:38
-
OK, I see. It is just the example in the link that is confusing. – LeOpArD Nov 24 '12 at 18:58