Other than BMP in DDraw?

Started by
3 comments, last by Phiro 21 years, 6 months ago
Easy question, does DirectDraw natively support any other graphic format other than bitmap? Also, I''ve read from a few places that alpha channels don''t work with DDraw - true or false? Would I be better off giving up using DDraw for my tile based game and going with D3D (for 2D)?
Advertisement
IIRC, DDraw doesn''t natively support .BMP files, either. There is no graphic file loading support in DirectDraw, so you have to make your own function.
I use CDisplay->CreateSurfaceFromBitmap, from ddutil.h/.cpp.
It uses LoadImage which is bmp specific I think, also DrawBitmap)

So I guess another way to ask would be, how can I load a graphic other than a bitmap. (then make a new surface, create the surface, and draw the image to the surface with something other than DrawBitmap)

i''ve heard ddraw has issues with the alpha channels before, but in my previous experience with ddraw7 i haven''t had any trouble.

dunno what that''s all about.

could be that if there''s no hardware support, it''s not emulated, so perhaps people think it''s broken? *shrugs*
dedrickwww.whiteknucklegames.com
[DDraw SDK, Blitting with Blt]
Alpha and Z Values

Opacity and depth values are not currently supported in DirectDraw blits. If alpha values are stored in the pixel format, they simply overwrite any alpha values in the destination rectangle. Values from alpha buffers and z-buffers are ignored. The members of the DDBLTFX structure that have to do with alpha channels and z-buffers (members whose names begin with "dwAlpha" and "dwZ"), and the corresponding flags for Blt, are not used. The same applies to the DDBLTFX_ZBUFFERBASEDEST and DDBLTFX_ZBUFFERRANGE flags in the dwDDFX member of the DDBLTFX structure.

Although z-buffers are currently used only in Direct3D applications, you can use IDirectDrawSurface7::Blt to set the depth value for a z-buffer surface, by setting the DDBLT_DEPTHFILL flag. For more information, see Clearing Depth Buffers.

For an overview of the use of alpha channels and z-buffers in Direct3D, see the following topics:

[DDraw 7 SDK]

I found this in The DirectX 7 SDK I have. So, I don''t think ddraw 7 supports alpha blending. You would have to emulate it yourself or use Direct3D instead to take advantage of hardware alpha blending.

This topic is closed to new replies.

Advertisement