Surface Locking

Started by
0 comments, last by Zanthos 22 years ago
I''m using DelphiX for a game, and was going to use DDraw alpha blending, and found it too slow, but when i looked at the actual DrawAlpha code, there was a Lock.. and a subsequent Unlock after the alphablit had been done. Why is locking necessary? I read in TOTWGPG it can take thousands of microseconds for a lock/unlock, which seems like a quick way of killing the frame rate. I''m going to try it removing the locking now, no idea if it''ll work or not, but if it does, why is the locking there?
Advertisement
DelphiX isn''t a Microsoft product and alpha-blending routines provided in this Delphi component are made by Hiroyuki Hori. He does alpha-blending "manually" computing destination pixels. Lock/Unlock is needed to get access to source surfaces and it''s not what makes the code slow - multiplying thousands of pixels from/to Video memory is SLOW.
As solution, you''d try using Direct3D to accelerate these operations using hardware.

This topic is closed to new replies.

Advertisement