Archived

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

Javelin

FPS drop in DDraw

Recommended Posts

Hello... I''ve experienced a wierd thing. I need to lock my surface and manipulate it manually. If I just lock the surface and run the loop that steps through all pixels (just index, no read/write) I''ve got around 160 FPS. When I add a line in the loop that gets the pixelvalue and stores it in a temp variable, my FPS drops to around 1.4! At first I thought that the compiler (Visual C++) removed the loop when it was empty, but without the loop I''ve got like 310 FPS... Pls help.... :| // Javelin -- Why do something today when you can do it tomorrow... --

Share this post


Link to post
Share on other sites
Reading from video memory is very slow. If you need to read it, you might want to look into having an array of values representing the surface in memory that you can read from instead of reading from the surface itself.



The hackers must have gotten into the system through the hyperlink!!

Invader''s Realm

Share this post


Link to post
Share on other sites
Tnx

Hmm... yes I know... but I was under the impression that the surface video memory is copied to main memory when you lock the surface...

Do you have to copy by youself if you want to manipulate surface data it in main memory?



// Javelin
-- Why do something today when you can do it tomorrow... --

Share this post


Link to post
Share on other sites