Jump to content
  • Advertisement
Sign in to follow this  
noatom

DX11 Dx11 + XNA in 2D

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

I want to draw in 2D,not in 3D so I thought there might be some problems.
I got the code model from a 3D simple example.And I'm interested in what I should change in that code to make it work in 2D.

Untill now I changed just how the projection matrix gets created,it uses an orthographic method,take a look:

[source lang="cpp"]XMMATRIX P = XMMatrixOrthographicLH(D3DApp::mClientHeight,D3DApp::mClientWidth,1,1000);[/source]

I also understand that I should disable the Depth buffer(since I'm in 2D there is no point to enable it).

But,should I change anything else to make drawing in 2D possible?

Share this post


Link to post
Share on other sites
Advertisement
In 2d graphics, you generally use sprites. I dont use XNA, but if you google something like "XNA sprites" you should find what you are looking for.

Share this post


Link to post
Share on other sites
ya microsoft naming style isn't the smartest in this case. You are talking about a library called XNAMath ( a C++ optimized math library) which has no relationship at all with XNA (C# Framework to create games). So make sure to use XNAMath or XNA Math when you google for informations.

Share this post


Link to post
Share on other sites
"XNAMath" is actually called "DirectXMath" in the latest version, just to add to the confusion. smile.png

Are you just working with sprites? If so, I would consider using DirectXTK. It has a sprite renderer + font rendering + basic texture loader, which is all you need for a simple 2D games. I don't know if there are any tutorials, but you should be able to figure out a lot of it on your own. There's some basic instructions here.

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!