Sign in to follow this  
Programmer557

Can Directx do 2D graphics?

Recommended Posts

Programmer557    124

I know this may sound kind of stupid, but that's what questions are for right?  I know that Directx can handle 3D graphics, but can it ONLY create 3D graphics?  I haven't started learning Directx yet because I still don't fully understand C++, but I want to learn before hand so I can trade up to SDL or something else for a 2D environment when I actually do start.

Share this post


Link to post
Share on other sites
Khaiy    2148
DirectX can do 2D graphics, though it will still use a 3D-esque approach to do it.

I would not recommend that you put your energy into learning DirectX just to abandon it for SDL later. APIs have their own quirks, and if you go to the trouble of learning one you may as well put that knowledge to use. If you want SDL or SFML or anything else eventually, why not use it from the start?

If you aren't confident enough in your C++ skills to start with an API right now, it would be better to read up on 2D graphics concepts rather than dive into something you don't plan to use.

Share this post


Link to post
Share on other sites
yewbie    677

I agree with Khaiy if your goal is to learn SDL start with SDL =)

The raw directx api can be a bit hairy for someone learning.

Share this post


Link to post
Share on other sites
ballmar    1586

There is a part of DirectX called Direct2D. This one serves for drawing 2D images on the screen surface. It has been updated with recent Windows 8 release. If you have a problem with C++, you can always use C# and third-party DirectX wrapper, like SharpDX. Creating 2D game with this library by using Direct2D is fairly easy, even for beginner.

Share this post


Link to post
Share on other sites
dilyan_rusev    1360

I've done a number of projects in SDL, and it is one of the simplest APIs I've used.

 

Now, I second @GuardianX  that DirectX contains a number of APIs, two of which are perfect for 2D games - Direct2D and DirectWrite. There is another native Windows component that you'd use in games - WIC (for loading/converting images, etc). They are available on Vista+ (in their first incarnations).

 

I've been evaluating D2D & Co for a future product, and... the API is C++ and COM, plus it requires a bit more knowledge about how computers work (compared to SDL). Which means that if you don't yet know C++, you'll have trouble with COM. Should you go that route, know that it has some getting used to (D2D is somewhat different than other 2D APIs I've used). Also, when you search for stuff online, you might not really find that much help. Both D2D and SharpDX (.NET binding) are quite newer than SDL, and the latter is an established technology.

As always, MSDN is your friend; besides the reference pages, you've got tutorials and how-tos; don't forget to take a look at Hilo, as well. For SDL, I'd recommend LazyFoo's tutorials.

Share this post


Link to post
Share on other sites

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