I want to know if I can develop graphics application with DirectX using C#?
Personally I'd recommend using SlimDX as XNA is lacking a number of features that the newer DirectX versions provide. SlimDX is a simple wrapper of unmanaged DirectX.
Managed DirectX is no longer supported - it's been largely superceded by XNA, which mostly targets games but which I dare say could be used for other graphics-heavy apps. The XNA section of MSDN is probably your best starting point.
As Jon Skeet says Managed DirectX is no longer supported. XNA is a really good alternative however and as far as I can tell it's basically a .Net wrapper for DirectX. I've ported XNA applications to DirectX in the past and the only differences I noticed relating to graphics calls were very simple differences in syntax.
Related
Is anybody aware of a possibility to use C# libraries like OpenTK (http://www.opentk.com/) from F#, too?
I'm especially interested in a Math toolkit library to give some scripts extra speed by taking advantage of the GPU from within F#.
What's a painless way to do that? :)
As Juliet mentions, you can use any .NET library from F#. Talking about OpenTK specifically, there is some material written by Laurent Le Brun (however, all of them are about graphics and not math):
An introductory article: F# + OpenGL: a cross-platform sample
More examples are in the samples/opengl directory in the F# cross platform project on CodePlex
It's probably not exactly the same thing as you're looking for, but it should help (e.g. if there are some tricky things that need to be done when using OpenTK from F#)
I dabbled in some game programming a few years back. I got up to using Windows Xp, C++, Ogre3d, Visual Studio, and Blender. I started to make an RTS but then real life happened.
Anyway, I'm looking to get back into it and I am wondering if there are any worthy alternatives to C++, now that Ruby,Python, and C# have become popular.
Is C++ still the preferred language?
I'm running Ubuntu now so I'd have to use some Ubuntu C++ IDE, C++, and Ogre3d.
Anyone used Ogre3d and moved onto something else?
Edit
Goals: Just hobby based 3d programming on the PC
I'm running Ubuntu at the moment but will move to Win7 someday
I imagine a simple game like Startopia
I know a bit about physics engines and sound and I've plugged Ogre3d components together before
So far I've seen that Ogre3d is still widely used. Might look into python and http://www.panda3d.org/
Cheers.
If you like to make games and not just spend all your time working on a feature of your game engine, I recommend you take a look at Unity 3D.
Features:
Game engine (not just a rendering engine)
Script in C#, or JavaScript (modified), or Python, or Boo
Awsome editor
Game can be deployed on: Linux/Windows/Mac/Android/iPhone/iPad/Xbox (and always extending)
Web player to play games in browser (after installing a tiny plugin)
Proven with great commercial games
Having experience with ogre3d is not enough to make a game like startopia as a hobby project. Have you done a finished game before?
Here's a post I found interesting:
http://greyaliengames.com/blog/the-6-steps-to-massive-game-development-success/
IMHO, you should go making 3D games like this at stage 4.
And also depends on whether your hobby is in engineering or making games?
If engineering, using ogre3d would make you learn better engineering skills.
Otherwise, trying to learn how to use an engine like Unity 3D, Torque or UDK would be better.
Everyone mentioned Ogre3D, which is good, but you could also look into Irrlicht: http://irrlicht.sourceforge.net/features.html
it's main advantage (at least to my knowledge) against Ogre3D is that it's more simple, in design and use.
Ogre3d is a fantastic graphics API that is great if you don't want to delve into some crap OpenGL or DirectX shader code for shadows and lighting and alpha ordering etc, but also don't want a true game engine with sound, networking, etc; it's only graphics.
I prefer Ogre3D to Irrlicht over the structure of the API, but it's entirely personal preference.
I might take some flak for saying this, but Java isn't a bad language if you are programming a simple game engine, Java and C++ are getting on pretty equal terms as far as speed nowadays.
C++ gives you a lot of low level access to make small optimizations that if you are experienced enough with, you can get some good performance gains. But optimization is a huge broad topic, especially with game engines.
Typically the average game programmer isn't going to dive into serious low level optimizations with their engines, but large game companies do.
C++ and Ogre are still a viable combination. On the other hand, MICROSOFT wants you to use C# and their XNA framework, and you always want to obey MICROSOFT... oh, wait, anybody know if XNA works with VS 2010 yet? It didn't, when I looked.
I'm thinking about writing a game using DirectX, and I'm considering using IronRuby.
Is IronRuby stable enough to use in production?
Does IronRuby work well with DirectX?
Yes, it is ready for production. Version 1.0 is available since April 2010. Please use it and give us feedback (link text). Regarding DirectX compatibility - I haven't tried t owrite anything but from a quick look at the managed DirextX API there seems to be no reason why it won't work. Most of the .NET APIs that are usable from C# or VB.NET are accessible from IronRuby as well. There are a few exceptions, some APIs rely on static types, but that shouldn't be the case for DirectX. We are working on enabling those as well in future versions.
I'm sorry I cannot address the IronRuby part of your question, but for managed DirectX, you could check out API Code Pack, which provides a managed wrapper for DirectX.
This question has additional details on managed DirectX Does XNA effectively replace Managed Directx?
This is a pretty deep topic I guess, so any url's with insight info is also gladly accepted.
I've been working a lot with native directx, never managed. On the other hand, mostly when developing other type of applications that don't have any need for advanced gpu rendering I usually stick to managed code such as C#. Starting to favor C# more and more, I've been thinking about trying out some managed directx.
So my question is if there are any remarkable cons and pros of using managed directx. Of course I'm mostly interested in potential drawbacks.
If I don't answer I probably had to go. Then I'll make sure to answer first thing tomorrow!
I look forward to hear your replies.
Jonas
Managed DirectX has been deprecated by Microsoft. You can still use it but it's probably not your best choice any more. Alternatives include XNA, SlimDX and the new managed wrappers in the Windows API Code Pack.
Another alternative to the now deprecated "Managed DirectX" is SharpDx. This has been benchmarked against XNA, SlimDX and the windows API code pack with favourable results.
What are the advantages of each over the other and is one easier than the other to learn?
Note: I develop with XNA and have never heard of DarkBasic until now.
XNA offers support for Xbox and Zune platforms and has a large community and is supported officially by Microsoft.
XNA documentation and tutorials are plentiful and many 3rd party sites and blogs exist around it.
XNA is in C# which I find much more intuitive as a programmer compared to VB.
After about 10 hours of reading and doing small tutorials for XNA I felt capable of coding nearly any type of game quickly and efficiently. I find the basic architecture very intuitive.
DarkBasic is older, based in basic which is probably not a great idea for non-students, and costs money, though very little. XNA is .NET based, generally C# based, and can target some devices like XBox and Zune. Personally, I'd recommend XNA over DarkBasic because you get very solid tools (IDE, debugger) from Microsoft. They're about similarly hard to learn.
As has been mentioned elsewhere, XNA allows easy development for the Xbox 360 and Zune platforms in addition to Windows. XNA also is built on top of C# whereas DarkBASIC seems to use a propriety BASIC-like language (as you would expect).
I'm not sure how crazy I am about the prospect of spending lots of time developing in a language of that sort, as I view my XNA projects as a way to sharpen my C#/.NET knowledge while learning the new XNA framework tools at the same time. (But that's just personal preference, of course.)
Unless there's some major upside to using DarkBASIC that I haven't seen, I would be pretty comfortable saying that XNA has an advantage over DB in almost every way.
As a beginner programmer, I've been learning DarkBASIC Pro on & off for the past year. I enjoy it and I wish I only started much earlier. I've got two sets of books to assist myself with DBpro;
"DarkBASIC Pro - Game Programming second edition"
"Hands On DarkBASIC Pro" I & II
All of which I can recommend if you're just starting out.
Also, if you are looking at coding in DarkBASIC, you're best to grab one of the newer IDE's, the most popular ones being either Synergy Editor or CodeSurge. Coding in the old original IDE is almost impossible once you've tried these new free ones.
With that, I can't comment on the advantages from one package to the other. I suppose it would depend heavily on what it is you're trying to do. But I do enjoy using DB Pro.
I've been teaching Game Development for C++ programmers with Dark GDK for a couple of years now and find it very fast to execute (because of DirectX 9) and very easy to program (if you are a C++ or C# programmer)
From
http://en.wikipedia.org/wiki/DarkBASIC_Professional:
Dark GDK and Dark GDK .NET
Dark GDK is a software development kit for C++. It implements most of the commands available in DBPro as well as give the user lower level access to the API. Currently Microsoft Visual Studio 6 and Visual Studio .NET 2003 are supported but The Game Creators have stated that they are planning to support Dev-C++ in future versions, although they have not yet extended support to Dev-C++, and the plans may be dropped now that Visual C++ 2005 is supported.[citation needed]. Dark GDK's API is very similar to that of DarkBASIC Professional, such that code can be very easily ported between C++ code utilising Dark GDK and DarkBASIC Professional code.
The Dark GDK is now also available with Visual C++ 2008 Express. Dark GDK is free for personal use, however you must purchase a license if you plan on selling a game made with Dark GDK.
Dark GDK .NET was created for the same purpose, except it allows the user to create games using Visual C# .NET or Visual Basic .NET. Unlike Dark GDK, Dark GDK .NET is only available commerically and has no free version.
In my opinion, the main advantages of each system over the other are as follows:
XNA allows you to develop for more target platforms, most notably the XBox 360 game console. DarkBasic's target platform is limited to Windows PC, whereas XNA can produce games for both Windows PC and the Xbox 360 (as well as the portable Zune device, which as far as I understand is not a very popular platform).
It appears that DarkBasic allows for a greater degree of RAD (rapid application development) programming than XNA allows for. I partially base my assumption on viewing GameCreator's "The 3D Gamemaker" product, which certainly allows for RAD development (and actually, even no programming required!). I realize that "The 3D Gamemaker" and DarkBasic are not identical products; however, Dark Game Studio (which includes DarkBasic) is foundationally engineered on the premise of "Build game content with specialised tools".
XNA is in my opinion probably slightly superior as a development language. This does not affect the overall quality of the end product, but only the programmer and the development of the product. XNA is designed to be a truly object-oriented language and is based on the .NET framework which enforces object oriented design. As far as I know, DarkBasic does support object oriented practices with its SDK; however I do not know to what degree DarkBasic supports object oriented programming. Having said that, nonetheless DarkBasic probably does support object oriented programming to an adequate, if not great, degree.
Dark Basic is for hobbiests. It's quick, easy, and effective.
XNA is for someone who has skills and time.
It's the classic Power vs. Effecincy. Similar to Python vs. C++, one's quick, one's powerful.