In case the title didn''t give it away, I am having a problem with my alpha blending routine. I have a really simple one: lock the surface, split the colors using my home-grown SplitColor16() function, average with alpha blend color, and put back on the surface. I unlock it, btw
. I have three problems with it.
1) As a test, I tried making it blend an NxN rectangle of the backbuffer with RGB16BIT(255,255,255). It works, but it averages EVERYTHING, not just the overlays. Do I need to write my own transparency code? There must be a better way.
2) I can''t control the blend ratio (or maybe intermix ratio
). I would really like to know how to do that. I am using a formula like this: Surface[x * (y + lPitch << 1)] = (Original + New) << 1; to average the new and old colors.
3) It is as slow as molasses in January! With a 200x200 rectangle (square
), I get 5.4fps. Needless to say, 5.4fps just isn''t good enough. I am doing every optimization I know of, without effect.
Thanks ahead of time for helping to solve yet another of my problems.
--------------------
You are not a real programmer until you end all your sentences with semicolons;
(c) 2000 ROAD Programming
You are unique. Just like everybody else.
Yanroy@usa.com
Visit the ROAD Programming Website for more programming help.