Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Sparkon

Member Since 07 Aug 2012
Offline Last Active Today, 09:29 AM

#5174243 Switching from XNA to DirectX9 for 2D platformer

Posted by Sparkon on 17 August 2014 - 04:47 AM

I'll try to address your question the best way i can ( i'm not the most experienced around here) ^^ :
- Direct3D11 should be available from Vista SP2+ if i'm not wrong. Choosing whether to support Windows XP or not is totally your choice, i would probably read some hardware surveys ( http://store.steampowered.com/hwsurvey | http://stats.unity3d.com/pc/index.html ). Yes, there are still many peoples running Windows XP ( unfortunately ) biggrin.png

- I'm sorry i'm not aware of any reference article that covers 'doing 2D with D3D', still, as i wrote the previous post and if you start googling around, most of the answers will reference :
- Textured quads
- GS
- Batching
and this is exactly how XNA would do it ( not GS tho ) [ https://directxtk.codeplex.com/SourceControl/latest#Src/SpriteBatch.cpp ]

- Direct3D vs OpenGL on Windows, argh this question ^^ Don't like this terrain... I cautiously tell you that D3D 'should' 'is supposed' 'might' be better than OGL on Windows platform mostly due to hardware support, but Valve wouldn't agree with me ( http://blogs.valvesoftware.com/linux/faster-zombies/ ) [ I took 'better' for 'faster' ]. I personally prefer D3D API to the OGL's one, but that's a matter of taste.

- I'm just going to mention this library, i don't think it really fits your purpose and i hate its API, but you've probably heard of it and you will : Direct2D. Developing games / wrapping it up is quite painful for the way it is structured, but undoubtedly has a crazy amount of features.

If you code your entire game with no wrapping, porting it to OpenGL is probably a hassle, if you start wrapping D3D calls / resources it will not be that hard to port it to OGL, not saying it is easy tho.

Another road you might take if you are going to port the game later is just dive into OGL and leave D3D aside for the moment.

Hope i was helpful, and you if need anything else, don't hesitate to PM me.

Happy coding smile.png


#5174234 Switching from XNA to DirectX9 for 2D platformer

Posted by Sparkon on 17 August 2014 - 03:19 AM

Hey,

I'll just point out few things :
 

- XNA bottleneck : As long as the game runs fine (60+ fps ) using XNA i don't see the need to switch to D3D for performance reasons. If you have a real bottleneck is probably somewhere else or you draw something like tens of thousands of particles in an inefficient way. The statement [ xna is working much slower than directx ] well.. it's too wide, it is true for obvious reasons, but at the same time, this performance difference should be negligible for the most part.  

 

- XNA / C# D3D / C++ : by switching to D3D9 i guess you were considering moving to C++ ( but you might be talking about Managed DX ). Learning D3D will be fulfilling in many ways, but not a wise choice if your purpose is to complete the game as soon as possible. C++ is a whole another language and will massively ( usually, don't take my word for wisdom ) increase your development time. 

 

- D3D9 : there is a new, much better ( depends ? ) version called D3D11 that provides backward compatibility with D3D9 hardware http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876(v=vs.85).aspx

 

- 2D with D3D : after you've properly chosen to use D3D11 and start looking for 2D help people will tell you : 2D is nothing else than rendering textured quads, well that's it really. There are many techniques that you can use ( naming Geometry Shaders, Instancing, Batching ) but it all revolves around 2 triangles being textured. If you come from XNA i'd really tell you to check out DirectXTK ( https://directxtk.codeplex.com/ ). It provides some XNA-like modules for D3D11. If you still don't want to use it, just dig in the source code to learn more.

 

- Platform games : same concepts apply to D3D

 

Have fun & happy coding : )




#5000142 C++ - Is Goto a Good Practice?

Posted by Sparkon on 12 November 2012 - 01:29 AM

IMHO the goto statement should not be used, but there are some few exceptional cases, for example if you are inside a nested-nested-nested loop than you might use it. There are other ways though ( better in my opinion ) .

I link you this http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html that was written by dijkstra about the use of GOTO statement. It's a good read!


#4997106 How to start?

Posted by Sparkon on 04 November 2012 - 01:25 AM


The new boston is a great site for video tuts


One of these days I really need to check out some of these tutorials.

I have heard, repeatedly, from people that are very good programmers, that these tutorials teach some extremely bad practices.


The tutorials are not bad, but as far as i've seen ( i'm not a very good programmer Posted Image ) the guy that makes the video does not have any kind of experience(except some websites). You can read on his "about" page http://thenewboston.org/about.php that he just reads book and the makes the video about them. Since he is teaching a lot of different subjects with no "real world" experience he does not have any good habit to teach. In my opinion tutorials are useful whenever you forget something and you want to give a simple look on how to implement something particular or after reading a book, if you missed something.

Beyond that i've seen some tutorials,vlogs and shows and he seems funny ;P ( indiechatter is better though)

p.s. excuse my english


#4996935 How to start?

Posted by Sparkon on 03 November 2012 - 12:33 PM

Hey! if you need anything i'd be glad to help you out! ( i'm italian too). If you wanna talk you can add me on skype ZOMBATOR676.
Beyond this.. IMHO you should start with python/pygame, It's a Object Oriented scripting language (beside that it's extremely powerful) with many modules built-in ( from socket to regex ) and will teach you quite good programming habits ( if you don't indent the program is not gonna run :P).


PARTNERS