Skip to main content
GameDev.net gamedev.net
🔒 Locked

Surface Locking

Started by Zanthos Apr 20, 2002 at 6:43 AM 0 replies 250+ views
Original Post
Zanthos
Zanthos
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?
Lifepower
Lifepower
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.