Archived

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

Mayrel

Two Questions

Recommended Posts

Question the First I have a problem with DDBLT_ALPHASRCCONSTOVERRIDE. I''ve loaded a bitmap onto a surface, and blit it to another surface (using IDirectDraw::Blt), but it doesn''t do any alpha blending, even when dwAlphaSrcConst is 0 (which the documentation tells me is 100% transparency). Do I have to do something special with the source, the destination or both? Question the Second When I use IDirectDrawSurface::GetDC(), the program runs much slower, even if I don''t do anything before releasing the DC again. Is there anything that can be done to speed up GetDC/ReleaseDC? I demand unsatisfaction!

Share this post


Link to post
Share on other sites
1. Unfortunately, DirectDraw 7 doesn''t have alpha-blending implemented.

2. Calls to GetDC and ReleaseDC are generally quite slow compared to other operations and I don''t think there is really anything you can do about it, other than only performing those operations when absolutely necessary.

Share this post


Link to post
Share on other sites
Initially, I was using FillRect. Happily, I read about DDBLT_COLORFILL, so I don''t have to do that kind of braindeath now.

But, I don''t know how to (for example) write text without using prerendered characters (I don''t really want to do that), or GDI (which is slow, but it''ll cope with Unicode on systems that support it).

''Nuff said. I''ll enjoy watching you live, demon.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
But, I don''t know how to (for example) write text without using prerendered characters (I don''t really want to do that), or GDI (which is slow, but it''ll cope with Unicode on systems that support it).

You could use pre-rendered characters, but generate them from GDI fonts. i.e at startup your program can use GDI to render all the characters in a font into an offscreen surface. Then when you need to draw some text just Blt/FastBlt the prerendered characters from the ''font-surface''.

Share this post


Link to post
Share on other sites
Well, I could do that, but I really don''t wanna. There are a great many fonts, which come in a great many sizes, which come in a great many styles. Sizing is particularly important - I would like to be able to zoom the text as I zoom in on the scene. If I prerender the fonts, that''ll either take up too much space, or the characters will look nasty when they''re big.

''Nuff said. I''ll enjoy watching you live, demon.

Share this post


Link to post
Share on other sites