Archived

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

Ivyn

API alternatives for 2D game programming

Recommended Posts

I''m working on some 2D games and I was wondering there are any other APIs out there besides DirectDraw. Two reasons I have for not wanting to use DirectDraw are... 1. It requires the user to have DirectX, since we target casual and computer illiterate users I don''t want to force them to download a huge DirectX 8/9 when I won''t even be using most of those features. (Yes I know Win2k and XP come with DirectX) 2. Microsoft has made DirectDraw obsolete. It can be independant or whatever, just there has to be some other API out there suited for 2D games.

Share this post


Link to post
Share on other sites
Microsoft has NOT made DirectDraw obsolete. What made you think that?

Anyways, if for some reason you don''t want to use it, try SDL. I''m pretty sure it uses DirectDraw on the back end.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
When you release your application, you can include the DirectX runtime libraries which the user can install on their computer. Basically, any API you use has either OpenGL or DirectX at it''s core.

tj963

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by tj963
When you release your application, you can include the DirectX runtime libraries which the user can install on their computer. Basically, any API you use has either OpenGL or DirectX at it''s core.

tj963


GDI doesn''t.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What about OpenGL? Doesn''t M$ Window$ include OpenGL by default?

I know it''s meant for 3D graphics, but 2D would be a pre-requisite, right? Don''t know for sure, as I am still learning DirectX at the moment - will try OpenGL later.

Share this post


Link to post
Share on other sites
Yes, you can use OpenGL for 2D rendering. In fact, it''s probably the best route if you want to use some "advanced" stuff like alpha blending excessively.

cu,
Prefect

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You could try allegro:

Advantages:

1. Simple to learn.
2. Active community (see www.allegro.cc).
3. Lots of add on libs. Eg. AllegroGL can be used to combine allegro and openGL.
4. Cross platform.

Disadvantages:

1. Bloated. Its a games programming library in general. Therefore there all sorts of input, sound, datafile etc functions that you''ll probably never need.
2. Blending function are a bit crap. Although fblend and allegroGL can improve this situation.
3. Ditto 3d functions. Don''t use these unless for really simple things(all done in software, no hware accel).
4. No support for alternative colorspaces to RGB.

Share this post


Link to post
Share on other sites
Allegro is a great, very easy to use library. And I wouldn''t call it bloated, since you aren''t forced to link everything. Just compile it without the added options.

And actually DirectDraw is somewhat obslolete, since there is no directdraw interface for version 9.0. In order to get a directdraw objet, you have to use a lower version, which is available in every higher version since it is COM.

Share this post


Link to post
Share on other sites
GDI, it can be sped up for resonable stuff.(Iike just drawing to bitmap memory directly yourself. Also you should prob get the users to download DX if you absolutely need the speed. it's starting to be like having shockwaveflash or something.


[edited by - quack on April 29, 2003 11:41:16 AM]

Share this post


Link to post
Share on other sites
I would use open gl exclusivly, all you have to do is specify you want to draw in 2DOrthogonal mode, and then you start drawing what you want. 1 pixel corresponds to 1 xy point, so it makes collision detection that much easier.

But you could cheat and use one of those game devlopment libraries.. but how fun is that? Build your own!

Share this post


Link to post
Share on other sites