Jump to content
  • Advertisement
Sign in to follow this  
Narf the Mouse

What's the best way to do 2D graphics in DirectX?

This topic is 2321 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

Edit: By "2D graphics", I mean the basics of drawing images/sprites on the screen.
Edit2: DirextX9 has Sprites, but DX11 doesn't. My engine is to support both.

I can see two solutions:

1) Paste images onto mesh quads and draw the quads.
2) Use Direct2D, which seems to be both depreciated? and not very featureful.

Further, tutorials on this issue would be appreciated.

Thanks. Edited by Narf the Mouse

Share this post


Link to post
Share on other sites
Advertisement
Here are some things that lead me to believe Direct2D is a good choice for 2D graphics in DirectX:

http://msdn.microsof...7(v=vs.85).aspx

[color=#2A2A2A][font=verdana,geneva,sans-serif]This topic introduces [/font][color=#ff0000][font=verdana, geneva, sans-serif]Direct2D, a new 2-D graphics API for Windows 7[/font][color=#2A2A2A][font=verdana,geneva,sans-serif]. Direct2D provides Win32 developers with the ability to perform 2-D graphics rendering tasks with superior performance and visual quality.[/font]

[font=verdana,geneva,sans-serif]What is Direct2D?[/font]
[color=#ff0000][font=verdana, geneva, sans-serif]Direct2D is a hardware-accelerated, immediate-mode 2-D graphics API that provides high performance and high-quality rendering for 2-D geometry, bitmaps, and text.[/font][color=#2A2A2A][font=verdana,geneva,sans-serif] The Direct2D API is designed to interoperate with existing code that uses GDI, GDI+, or Direct3D.[/font]

[color=#2A2A2A][font=verdana,geneva,sans-serif]Direct2D is designed primarily for use by the following classes of developers:[/font]

  • [font=verdana,geneva,sans-serif]Developers of large, enterprise-scale, native applications.[/font]
  • [font=verdana,geneva,sans-serif]Developers who create control toolkits and libraries for consumption by downstream developers.[/font]
  • [font=verdana,geneva,sans-serif]Developers who require server-side rendering of 2-D graphics.[/font]
  • [color=#ff0000][font=verdana, geneva, sans-serif]Developers who use Direct3D graphics and need simple, high-performance 2-D and text rendering for menus, user interface (UI) elements, and Heads-up Displays (HUDs).[/font]

    [font=verdana, geneva, sans-serif][/quote][/font]

    http://msdn.microsof...8(v=vs.85).aspx
    [font=verdana, geneva, sans-serif]
    [/font][font=verdana,geneva,sans-serif]Here are some of the [color=#ff0000]new[color=#ff0000] additions to Direct2D for Windows 8[color=#2A2A2A] Release Preview.[/font]
    [color=#2A2A2A][font=verdana,geneva,sans-serif]The list here shows these features and some related interfaces.[/font]
    [color=#ff0000][font=verdana, geneva, sans-serif]Starting with Windows 8 Direct2D is built on top of Direct3D 11.1[/font][font=verdana, geneva, sans-serif].[/font]
    [font=verdana, geneva, sans-serif][/quote][/font]

    [color=#ff0000]Direct2D Quickstart for Windows 8 - http://msdn.microsof...0(v=vs.85).aspx

Share this post


Link to post
Share on other sites
Direct3D 9 doesn't actually have sprites.

What it has is a wrapper around vertex buffers, index buffers, textures, states and regular geometry. That's exactly all that ID3DXSprite is - a wrapper that draws ordinary textured triangles. It makes calls to the lower-level D3D API using code that you can write yourself, so that option is also there for 10 and 11.

Share this post


Link to post
Share on other sites

Direct3D 9 doesn't actually have sprites.

What it has is a wrapper around vertex buffers, index buffers, textures, states and regular geometry. That's exactly all that ID3DXSprite is - a wrapper that draws ordinary textured triangles. It makes calls to the lower-level D3D API using code that you can write yourself, so that option is also there for 10 and 11.


Direct3D9 has ID3DXSprite as you stated. Therefore, Direct3D9 has sprites.

Everything in programming is a 'wrapper' for something else, when you think about it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!