Dx11 + XNA in 2D
Members - Reputation: 692
Posted 29 September 2012 - 04:35 AM
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?
Alexander Turda - The place where I talk about games, coding, movies, and whatever passes through my mind.
Crossbones+ - Reputation: 1765
Posted 30 September 2012 - 01:26 AM
Moderators - Reputation: 8488
Posted 01 October 2012 - 08:10 AM
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.