Archived

This topic is now archived and is closed to further replies.

supagu

CopyRects

Recommended Posts

supagu    148
copy rects don''t seem to be working for me.... POINT test; test.x = 0; test.y = 0; HRESULT r = 0; r = g_pd3dDevice->CopyRects(this->image,NULL, 1, g_pBackSurf ,&test); if(FAILED(r)) { if( r & D3DERR_INVALIDCALL) MessageBox(g_hWnd, "copy surface fast","error",MB_OK); } how much faster is copyrects over D3DXLoadSurfaceFromSurface, because when im using D3DXLoadSurfaceFromSurface, it seriously reduces my frame count, when i load a surface onto the back buffer, im guessing this is due to the stretching that slows it down? any way, icant get CopyRects to seem to work....

Share this post


Link to post
Share on other sites
Madness    122
g_pd3dDevice->CopyRects(this->image,NULL, 1, g_pBackSurf ,&test);


where you puut this->image
shouldnt that be a pointer to another surface ?
i''m not an expert


but Copyrects is faster coz it copies the whole area in one time, it think using hardware

and CopySurfaceToSurface copies pixel per pixel to the other surface , so it''s slower

Share this post


Link to post
Share on other sites
supagu    148
hrmm, well using copytosurface reducaes my frames from about 300 to about 60, and the
this->image
where
image is...
LPD3DSURFACE8 image;
^if i aint spelled that right, yer know what i mean, dun ya?

Share this post


Link to post
Share on other sites
supagu    148
okay, i can get CopyRect''s working with 2 different surfaces, but when i try to copy to the back buffer, it fails, could it be something needs to be locked? or they need to be the same format? or ene thing else?

Share this post


Link to post
Share on other sites