Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Dx11 + XNA in 2D


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 noatom   Members   -  Reputation: 785

Like
0Likes
Like

Posted 29 September 2012 - 04:35 AM

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?

Sponsor:

#2 Slig Commando   Members   -  Reputation: 334

Like
0Likes
Like

Posted 29 September 2012 - 10:01 PM

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.

#3 noatom   Members   -  Reputation: 785

Like
0Likes
Like

Posted 30 September 2012 - 12:44 AM

Actually I'm using C++,I can't find a sample/tutorial with it,only c#!

#4 kunos   Crossbones+   -  Reputation: 2207

Like
0Likes
Like

Posted 30 September 2012 - 01:26 AM

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.
Stefano Casillo
Lead Programmer
TWITTER: @KunosStefano
AssettoCorsa - netKar PRO - Kunos Simulazioni

#5 MJP   Moderators   -  Reputation: 11589

Like
0Likes
Like

Posted 01 October 2012 - 08:10 AM

"XNAMath" is actually called "DirectXMath" in the latest version, just to add to the confusion. Posted Image

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS