Jump to content
  • Advertisement
Sign in to follow this  
XXOXX123456

DX11 I should draw Everything with GPU?

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

Advertisement

including 3D Mesh or 2D lines ,primitives or image or sth else?. In dx11 , is that directdraw was abandonded???

 

Yes, you should use Direct3D to draw on screen, but you can also combine it with other APIs like the old and legacy GDI/GDI+ or Direct2D.

 

DirectDraw was deprecated since DirectX 9... You can read more about here: Whither DirectDraw? http://blogs.msdn.com/b/chuckw/archive/2010/06/16/wither-directdraw.aspx

Share this post


Link to post
Share on other sites

 

including 3D Mesh or 2D lines ,primitives or image or sth else?. In dx11 , is that directdraw was abandonded???

 

Yes, you should use Direct3D to draw on screen, but you can also combine it with other APIs like the old and legacy GDI/GDI+ or Direct2D.

 

DirectDraw was deprecated since DirectX 9... You can read more about here: Whither DirectDraw? http://blogs.msdn.com/b/chuckw/archive/2010/06/16/wither-directdraw.aspx

 

you mean= =VS & PS??So I should draw 2D images with no 3D transformation in shaders?

Share this post


Link to post
Share on other sites

Practically yes. Why bother with DirectDraw?

Oh, I think the effect framework(.fx) gains complexity as the shader code size grows,so it may be more convenient to use API= =?(maybe)  BTW, making shaders as well as interfacing them with C++ is so unconvenient ,do you have some advice?

Share this post


Link to post
Share on other sites

The easiest way to render 2D shapes is using a Sprite class. DirectX 11 AFAIK no longer has a default one, but previous versions do. If there is no default one, find an existing one.

 

This class will map your traditional pixel coordinate system to the view-port coordinate system.

 

From the very basic nature of your questions I would assume that your knowledge level is not that high in this domain, so I can't point you to a working solution.

 

What you should do is familiarize yourself with drawing to the raw coordinate system without a transformation matrix. You could download SharpDX, and in the samples folder there is one that draws a triangle: Samples\Direct3D11\MiniTri.

 

Adapt that one to draw a rectangle and after you have mastered that, adapt it to create the rectangle at pixel coordinates.

Share this post


Link to post
Share on other sites

 

you mean= =VS & PS??So I should draw 2D images with no 3D transformation in shaders?

including 3D Mesh or 2D lines ,primitives or image or sth else?. In dx11 , is that directdraw was abandonded???

 

Yes, you should use Direct3D to draw on screen, but you can also combine it with other APIs like the old and legacy GDI/GDI+ or Direct2D.

 

DirectDraw was deprecated since DirectX 9... You can read more about here: Whither DirectDraw? http://blogs.msdn.com/b/chuckw/archive/2010/06/16/wither-directdraw.aspx

 

 

 

DirectX Too Kit has a sprite and a font library in replacement for the old D3DX library and it uses Direct3D11 :http://directxtk.codeplex.com/

You can also use Direct2D, like this project: https://d2d1renderer.codeplex.com/

 

You can see how to draw 2D elements with Direct3D 11 and some simple shaders on Rastertek tutorials (note: the code itself is not the at state of art) http://www.rastertek.com/dx11tut12.html and http://www.rastertek.com/dx11tut46.html

 

A lot of tutorials are hosted on MSDN, like these for Direct2D http://code.msdn.microsoft.com/site/search?query=Direct2D&f%5B0%5D.Value=Direct2D&f%5B0%5D.Type=SearchText&ac=2

 

If you are considering using Direct2D, you should also read this about D3D and D2D interoperability: http://msdn.microsoft.com/en-us/library/dd370966.aspx

 

You can also use other 3rd party libraries, I'm sure there are tons of them around the web, free and commercial...

Edited by Alessio1989

Share this post


Link to post
Share on other sites

Direct2D isn't about the kinds of 2D graphics you might be thinking of for games -- its more for vector-based rendering, for example, high-quality, DPI-independent glyphs, shapes, etc. It can do textured quads just fine, but its not really built for that, and since its just another layer on Direct3D, you may as well use Direct3D for that scenario to begin with.

 

SpriteBatch and similar are probably what you're looking for for 2D bitmap games. DxTK has one, I think.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!