Sign in to follow this  

Is using DirectDraw enough?

This topic is 4834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Diablo II had an option to use D3D. I think it was primarily used to improve lighting effects. I don't know about other specific games, but I do know that doing 2D games using a 3D API is definitely a viable option, and has many benefits over using a 2D API. The biggest downfall is that it is usually a bit more complicated to get the basics working. But once you have the basics working fine, a lot of stuff becomes a lot easier.

Plus, 3D APIs are still up-to-date and active, whereas 2D APIs, especially DirectDraw, are becoming old very quickly.

I would recommend at least considering using a 3D API for any 2D game you might make. I think someone found a bunch of useful links on the topic... in this thread.

Share this post


Link to post
Share on other sites
I would say it is 'iffy' as to how long DirectDraw will stay around.

Our solution to the problem was to make our engine be able to use 'any' api through an adaptor interface system, while this system provides great flexibility in the choice of API, it also imposes some harsh constraints (mainly every api adaptor needs to support the same function set, or you get feature 'spotyness'), I have written 2D rendering code in both DirectDraw and Direct3D, and my summary is this.

Using DirectDraw gives you simple, and fast 2D blitting with color keying, advanced features such as alpha blending, are nearly impossible to implement and maintain speed.

-DirectDraw, simple, no advanced features

Using Direct3D for 2D rendering, at times, felt very overkill and as required me to 'bend' the API at times into ways it felt it did not want to be bent, the main problems were texture size constraints, to be safe you should not create a texture bigger than 256x256 pixels, this means that to support larger images (a full screen background image for instance) you will need to build a system to provide 'large image emmulation' which splits the single large image, into a bunch of smaller ones, and can then draw them as one. The other drawback was the need to batch images by texture, this is very counter intuitive to normal 2D programming, and required the building of a batching system, and required use of the ZBuffer. For all this though, you get, Alpha Blending, Color Modulation, Rotation, Texture Filtering, and managed textures (not lost durring alt-tab).

-Direct3D, hard to implement if your of 2D background, lots of features

I hope this have given you some guidance as for which to use, use the one that bast suits your needs=)

Share this post


Link to post
Share on other sites
For 2D drawing currently I think SDL is one of the best (if not the best) option. Unless you want to use many special features from Direct3D, paying the price of a harder implementation, I'd go for SDL.

It's an alive API, not like DDraw, and features things like Alpha Blending, which you wouldn't have unless you used Direct3D. Even more, SDL is multiplattform, and can be used for audio, input, event management, networking...

If you already know DDraw or other similar API going for SDL is an easy step. After all, the "S" stands for "Simple".

And even when the basic library might not have many functions besides of the basic ones, you can download free libraries that implement almost everything you need (primitive drawing, fonts, loading images from almost any format, rotozoom, etc..)

You can download it freely from: www.libsdl.org

Hope it's helpful for you.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sante05
It's an alive API, not like DDraw


That's a superfluous statement, considering the SDL uses DDraw by default on Windows. The biggest benefit from SDL comed from putting a common interface on mutiple platforms. But even for a single platdform there's a benefit, as you would be implementing most of what it provides anyway.

Share this post


Link to post
Share on other sites
Quote:
Original post by Aldacron
Quote:
Original post by Sante05
It's an alive API, not like DDraw


That's a superfluous statement, considering the SDL uses DDraw by default on Windows. The biggest benefit from SDL comed from putting a common interface on mutiple platforms. But even for a single platdform there's a benefit, as you would be implementing most of what it provides anyway.


It still is actively supported. If Direct Draw support now was to be removed totally from DX in the near future (although perhaps very unlikely), I am quite certain SDL would evolve around this. This could be done either by adapting OGL or D3D, or actually start to write a Windows specific hardware abstraction interface (eg. what Direct Draw currently does).

Share this post


Link to post
Share on other sites
DirectDraw can never, and will never dissappear more than it already has, DirectX has to support it. But it is no longer included in the SDK's officially, you need to dig to find it. This is very unlikely to change.
DirectDraw is fine for any kind of 2D game, you will just have to rethink a lot of effects and stuff that DirectDraw can't do. Other than that, you'll be fine with DirectDraw.
Want a piece of advice though? Go with D3D or OGL, and you won't have to do any compromising.

[Edited by - Bad Maniac on August 30, 2004 5:48:43 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Unwise owl
I am quite certain SDL would evolve around this. This could be done either by adapting OGL or D3D, or actually start to write a Windows specific hardware abstraction interface (eg. what Direct Draw currently does).

This has already been implemented: SDL will automatically switch to GDI rendering if the machine lacks DDraw support.
It seems very unprobable that microsoft would decide to drop GDI within the next couple of decades.

Share this post


Link to post
Share on other sites
Quote:
Original post by doynax
This has already been implemented: SDL will automatically switch to GDI rendering if the machine lacks DDraw support.
It seems very unprobable that microsoft would decide to drop GDI within the next couple of decades.


Not really, since it WILL be dropped when Longhorn arrives.

Share this post


Link to post
Share on other sites
Unless Microsoft is crazy,
and wants to anger people by making them buy new versions of software that work for longhorn, I am confident that there will be a GDI translation layer that maps appropriately to the new Graphics Device Interface =)

However, 'I' personaly do not feel confident that DirectDraw will be around in the next 5 years, perhaps even sooner, I would imagine that it is likely to be replaced with a new API *perhaps the new GDI* that is specially made for 2D rendering using 3D hardware.

Pure speculation, but I guess we will see=)

Share this post


Link to post
Share on other sites
Quote:
Original post by EDI
Unless Microsoft is crazy,
and wants to anger people by making them buy new versions of software that work for longhorn, I am confident that there will be a GDI translation layer that maps appropriately to the new Graphics Device Interface =)

However, 'I' personaly do not feel confident that DirectDraw will be around in the next 5 years, perhaps even sooner, I would imagine that it is likely to be replaced with a new API *perhaps the new GDI* that is specially made for 2D rendering using 3D hardware.

Pure speculation, but I guess we will see=)


DirectDraw will be around for as long as DirectX is around. It's inclusion is guaranteed by design.

Share this post


Link to post
Share on other sites
Quote:
Original post by MichaelT
Quote:
Original post by EDI
Unless Microsoft is crazy,
and wants to anger people by making them buy new versions of software that work for longhorn, I am confident that there will be a GDI translation layer that maps appropriately to the new Graphics Device Interface =)

However, 'I' personaly do not feel confident that DirectDraw will be around in the next 5 years, perhaps even sooner, I would imagine that it is likely to be replaced with a new API *perhaps the new GDI* that is specially made for 2D rendering using 3D hardware.

Pure speculation, but I guess we will see=)


DirectDraw will be around for as long as DirectX is around. It's inclusion is guaranteed by design.


While it may still formally 'work', the performance considerations are a totally different issue. On my newest computer's graphics card I run sprite heavy 2D Direct Draw games more slowly than on the older computers I got. Quite apparently the reason is all the background conversion that is going on; blitting instructions with free-sized surfaces are hardly efficient to modern 3D graphics cards.

Share this post


Link to post
Share on other sites
why haven't i read opengl here?
in orthogonal mode it's just awesome for 2d drawing

+ you can expect it to stay around for quite a while
+ platform independent
+ way easier than ddraw or d3d (IMO)

can't think of any downsides right now ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by nev
can't think of any downsides right now ;)


Driver support for one. If there is no support it will(hopefully) run in software mode and that is not a pleasant experience ;)

Share this post


Link to post
Share on other sites

This topic is 4834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this