Two Questions

Started by
6 comments, last by Mayrel 22 years, 5 months ago
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!
CoV
Advertisement
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.

1) So I''d have to use Direct3D?

I demand unsatisfaction!
CoV
Probably...

GDI will still be slow in Direct3D. What are you trying to do with GDI?
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
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.
CoV
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''.
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.
CoV
look at cd3dfont in the sdk
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials

This topic is closed to new replies.

Advertisement