That being said, the best way to do alpha blits is to let the 3D card do it for you, via D3DIM.
Mason McCuskey
Spin Studios
www.spin-studios.com
That being said, the best way to do alpha blits is to let the 3D card do it for you, via D3DIM.
Mason McCuskey
Spin Studios
www.spin-studios.com
I suppose you are right, but I don't have a 3D card and am working on a 2D project.
Having the surface as a sysmem DDraw surface would work, I suppose, but i am still stuck with this:
read/write->sysmen
sysmem->BLT->backBuffer
backBuffer->Flip()
is this correct?
or should I do
read/write->sysmem
sysmem->Blt->Primary
?
I want to use 16 bpp, so I create my Primary and Backbuffer surfaces, great.
I want to use transparency, so there will be pixel reads, and pixel reads from VRAM are horrible, so my compositing page can't be in VRAM. No problem.
I make my own off-screen surfaces with malloc, making sure they are aligned to the backbuffers lPitch value to increase block copies.
I compose my frame to my offscreen surface, get a lock to DDBackBuffer, memcpy my offscreen to the DDBackBuffer, Unlock and Flip().
is this how I should do it? Or should I blast the composited offscreen image of my own directly to the Primary? Will I get too much tearing?
What are my options here? What mechanisms are others using?
all Flip does is change some video registers, so it's extremely fast. also, Flip eliminates tearing, so unless you can't even fit the backbuffer into video memory, you should blit to backbuffer and flip