I'm a student, and for my next job, I have to program a module which is very similar to the features of the VTK (http://www.vtk.org/VTK/project/imagegallery.php).
I've had some success with the vtk, but now we're having problems, that not even my boss can solve. I want to try my luck with learning one of the frameworks listed above.
Which one would be the best for my project? I'm using C# and read about dx, that the managed variant will no longer be supported. And XNA is more specialized for game development, isn't it? Will openGL also be used in the future? I don't want to learn the language for nothing... I would also want to develop some little game projects at home and put it to my curriculum vitae.
So at the moment I'm confused, maybe someone here can help me with my decision.
VTK uses OpenGL. OpenGL is common in research and CAD-style professional modeling packages, as well as id Software games and games running in Mac OS X natively. This includes the Source engine (Half-Life 2) and World of Warcraft. It has the benefit of being cross-platform.
DirectX is very popular for game development on Windows and Xbox 360, although it is also used for scientific visualization. XNA is a managed framework build over DirectX to make it easier to make games. If you want to use C# to write scientific applications, you might consider SlimDX, which is an open-source replacement for Managed DirectX. DirectX and related technologies only run on Microsoft OSs.
Even though this is not strictly game-related, you might have more luck having this question answered at: https://gamedev.stackexchange.com/
Personally, if I had to use C# to get this job done I would use the XNA framework even though it is designed more for games (although there are some difficulties integrating it into Windows Forms).
You could also consider WPF since that has a capable 3D renderer too.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have been learning C# for a time now. I basically come from a non-developing background (means I dont know the actual working of different programming tools). I just started learning Monogame but few things confused me.
Firstly it says that Monogame is open-source implementation of XNA. What does it mean?
-that it makes XNA open-source
-or takes features of XNA and implements it itself but with same function names etc. as XNA
-any other
And is it allowed and legal? If yes, can I copy any app in any app store and make my own version? What needs to be different for it to be legal?
Secondly when I installed Monogame, SharpDX was also installed. When I searched about it, I found that SharpDX is managed DirectX (I have never worked in DirectX). What is the link between Monogame and SharpDX (or XNA and DirectX) and cant I use monogame or SharpDX separately? And what does it mean by managed DirectX?
Thirdly are there more cross-platform C# frameworks other than those provided by Xamarin? I cant find more.
What does it mean?
Monogame is another implementation (same interface, different underpinnings) of XNA
And is it allowed and legal?
I don't know XNA's terms offhand, but typically Microsoft allows duplicates of this sort (see the original Mono). You can do research on the license for XNA if this concerns you.
Can I copy any app in any app store and make my own version? What needs to be different for it to be legal?
I am not a lawyer (especially not a copyright lawyer), a couple of things to steer you in the right direction, mostly it boils down to copies ideas is fine, copying anything concrete is not.
Making a match 3 game - Okay
Using images from Candy Crunch - Not okay
Decompiling Angry Birds and using their physics engine directly - Not okay
Playing around with Angry Birds and duplicating the physics engine - Okay
So if you wrote it and were inspired that is fine, but if you take it that is not fine. Also note that there is a significant grey area when it comes to decompilation so I wouldn't do anything related to that if you want to sell your product. (Or even put it on an app store)
On a less objective note, don't try and copy something directly, if it is popular you won't replicate that success just by being the same. Find an idea you like and tweak it to make it more interesting at the least.
What is the link between Monogame and SharpDX (or XNA and DirectX) and cant I use monogame or SharpDX separately?
Monogame probably uses SharpDX on Windows and/or XBox (both of which have DirectX as an option). SharpDX is an externally maintained managed interface to DirectX. Rather than redoing that work they use it. Whether you need it depends on your platform. It would be useless on Android or iOS for instance, since neither of those platforms supports DirectX.
Thirdly are there more cross-platform C# frameworks other than those provided by Xamarin?
You need to define framework and probably cross-platform if you want an answer to this question. For instance Mono is basically the only cross-platform framework by using the .NET Framework definition of framework.
Firstly it says that Monogame is open-source implementation of XNA. What does it mean? -that it makes XNA open-source -or takes features of XNA and implements it itself but with same function names etc. as XNA -any other
Let's start at the beginning. To fully answer your questions you'll need to understand a bit of history.
Firstly, XNA is a set of tools provided by Microsoft that facilitates video game development. XNA is based on the .NET Framework, with versions that run on Windows, Windows Phone and XBox.
MonoGame is an open source implementation of XNA with the goal of making it truly multi-platform. It allows existing XNA developers to port their games to many other platforms using nearly identical code. So while developers used to be restricted to only Microsoft platforms they can now also deploy games on iOS, Android, Mac OS X, Linux, Windows 8 Store, Windows Phone 8, PlayStation Mobile and OUYA.
The other important thing to realise is that Microsoft is no longer supporting XNA in the future. MonoGame has become a very attractive replacement for XNA developers even for Microsoft platforms.
And is it allowed and legal?
That's a good question. While it may seem on the surface to be potentially dangerous ground, and I'm no lawyer, there appears to be plenty of evidence that Microsoft is okay with it.
For example, Skulls of the Shogun was developed using MonoGame, published by Microsoft and released on Xbox, Windows 8 and Windows Phone 8.
There are also some other examples, like TY the Tasmanian Tiger and Lee Stott (Microsoft UK Evangelist) talking about MonoGame.
can I copy any app in any app store and make my own version? What needs to be different for it to be legal?
No. You can't just copy an existing app. You'll quickly run into copyright and trademark law infringements if you do this. Even if you create a game with too many things similar to an existing game it can upset people and you may find yourself in some trouble. Believe me, I've had to deal with this before and it's not fun.
That said, copyright law can't prevent you from making your own games if you have some originality and creativity.
"Copyright does not protect the idea for a game, its name or title, or the method or methods for playing it. Nor does copyright protect any idea, system, method, device, or trademark material involved in developing, merchandising, or playing a game. Once a game has been made public, nothing in the copyright law prevents others from developing another game based on similar principles. Copyright protects only the particular manner of an author’s expression in literary, artistic, or musical form." - http://www.copyright.gov/fls/fl108.html
If you think you might be at risk I suggest doing some reading.
Secondly when I installed Monogame, SharpDX was also installed. When I searched about it, I found that SharpDX is managed DirectX (I have never worked in DirectX). What is the link between Monogame and SharpDX (or XNA and DirectX) and cant I use monogame or SharpDX separately? And what does it mean by managed DirectX?
DirectX is an API for handling tasks related to game development on Microsoft platforms.
SharpDX is a layer that sits on top of DirectX to allow it to be used in managed languages like C#.
OpenGL is an API for handling tasks related to game development on non-Microsoft platforms.
OpenTK is a layer that sits on top of OpenGL to allow it to be used in managed languages like C#.
MonoGame uses SharpDX on Microsoft platforms and OpenTK on non-Microsoft platforms.
(actually, it's not that simple but you get the idea)
Thirdly are there more cross-platform C# frameworks other than those provided by Xamarin? I cant find more.
Xamarin has pretty much cornered the market in the multi-platform C# area. The only other option I can think of is Unity but it's not really a framework, it's a full game engine.
I've been mostly programming in C++ as of late, but to be honest I think I need something else I could use. C++ being quite low level requires much more time to make things. It would be nice to know another popular language that is easier to code in. If I were to use C# I'd probably use XNA with it as well, however I'm not quite sure about Java. I know that Java is more cross-platform than C# and that C# is pretty much in Microsoft's pocket however that doesn't bother me. I'm mostly gunning for 2D ASCII/Sprite games as opposed to 3D, however 3D is indeed something I'll eventually move on to.
I want to know what the Stack-overflow community thinks.
XNA is really easy to use for 2D games. Not only does XNA give you content pipeline management within Visual Studio, which makes managing the entire build job quite easy, the framework also sets up a basic game loop and gives you the building blocks to get started. There are plenty of getting started guides and even a growing pile of books on XNA.
XNA works with the free version of Visual Studio and XNA runs on Windows Phone and the Xbox 360 (unfortunately deploying to either of these platforms requires a $100 a year license from MS).
I am sure there are good libraries for Java as well, but I can't give you any details.
I know this was answered quite a long time ago, but on the Java side of things you could have easily used libGDX. It is totally open source and simple to learn the basics. It supports Android, IOS, Desktop (Mac, Windows, and Linux via the JVM), and HTML5. The only (small) learning curb is figuring out how to set a libGDX project up via the Eclipse GUI, but if you are a command line person (and most people here are) then this is one of the most qualified frameworks out there.
I've tried out both and although XNA 3.1 attracts me more because of the ease of being able to just spew code out and not having to worry about memory and garbage clean up and all the nitty gritty crap. You get to write the fun part of the code (if thats even existant :D). However XNA restricts me because I cannot port anything I write with it to Linux or Mac OSX, and even then it makes people who want to play my games have to download .NET 3.5 Redistributable and XNA 3.1 Redistributable which should just not happen. I should be able to just have some DLLs in there as opposed to making my gamers go online and download stuff. Even then there is still the fact that the code will become an absolute mess over time because of the whole "one file for your game" default policy with XNA.
Which do you think is superior?
Really this is going to depend on your level of experience with C++ and if you really see not being able to port your code as a big problem. As for the memory management stuff...
SDL gets a lot easier when you use some of the new features in the C++0x standard such as shared_ptr and unique_ptr, lambdas etc. Even the things in the SDL that require raw pointers are doable as you just use the .get() function on your smart pointer and your life is much easier.
In short: Good at C++ and if you are really interested in easily porting your game to other Systems then I would go for SDL. If you only really know C# and dabble in C++ and it's not a huge deal to only have your game on Windows and Xbox then definitely go for XNA.
I personally prefer XNA. Regardless of personal bias, Microsoft knows how to make some pretty mean software dev tools. XNA is very seamless, and despite its limitations is a wonderful experience. Although the lack of portability is frustrating, at least you can put it on the xbox :)
What do you mean 'one file for your game' policy? You can create just like any other VS project.
From personal experience, far and away XNA. Being able to - to use your phrase - "just spew code out" and rapidly throw things together is a huge benefit in game development.
Obviously I do not advocate that all code is "spewed" out. But the nice thing about C# and XNA is that they give you the option to be less careful about how you code - which you can then exercise in places where it is appropriate.
With C++ and SDL you are forced to write the vast majority of your code "carefully". (Not to mention the fact that you will get it wrong at some point, and C++ is so much more unforgiving about this.)
Some of the problems you mention ("one file for your game", requring a .NET 3.5 redistributable) are not actually problems with XNA - as discussed by Veered and myself in comments. Also, if you use ClickOnce to distribute your games, then it will handle the necessary download and installation of XNA and the .NET Framework for you.
If you have identified a need to port to Linux and Mac, then I would still advocate using C# (via Mono) as a development language - even if you have to use something other than XNA on those platforms.
And there are a bunch of other nice things about XNA and C# - the considerably faster compile times, the content pipeline, the support/updates from Microsoft, the ease of porting to Xbox 360 and Windows Phone, the library of well-written examples, etc.
My vote is for XNA.
I actually began my game using SDL.NET + C# (which covers the memory management that you described, while staying true to SDL) awhile back to learn C#. So if you do indeed like the perks of .Net you could check into that. However, once I discovered XNA and messed around with a few small test games I decided that porting my work over to XNA would be worth it (as I didn't care for cross platform anyhow).
I do understand what you mean when you say the 'one file approach'. Although as others mentioned, this isn't the actual end result, just the way it is presented to be like 'Hey look how easy everything is, update and draw now you got a little guy walkin around shooting fireballs out of his eyes!' Things in XNA feel much more structured than SDL, more hand holding if you will. XNA is easy to pick up and to get done what needs to get done, letting your good coding practices fall into play along the way.
I want to learn about programming 2D games in C#. What are the best tutorials that are beginner oriented, written for C#, and preferably use GDI+ (or something equally simple)? I am relying on the experience this community has to direct me towards the best.
Books
Beginning .NET Game Programming
Beginning C# Game Programming
Links
Coding 4 Fun is a great .NET resource that has quite a few user-created games. They also have a book and a 2-D game primer
Tutorial Listing at C# corner
C# Game Tutorial for Beginners (video)
Link to more game programming e-books
Advanced Topics
The Farseer Physics Engine on Codeplex would be a good next step once you get comfortable with programming games. You could even end up contributing to the project if you like it enough. I'm sure they'd appreciate the help.
I watched these DNR TV episodes recently and thought they were very well done and informative.
http://www.dnrtv.com/default.aspx?showNum=165
http://www.dnrtv.com/default.aspx?showNum=166
These focus on XNA, which is definitely where I'd start if I was planning on creating a game. Their tutorial take you through:
creating a 2D game with:
collision detection
texture creation and usage
geometry creation
physics simulation (They use an open-source physics engine and show you how to use it)
If you haven't heard of XNA:
The framework runs on a version of the Common Language Runtime that is optimized for gaming to provide a managed execution environment. The runtime is available for Windows XP, Windows Vista, Windows 7, and Xbox 360 [also can be played on Zune HDs].
XNA attempts to free game developers from writing "repetitive boilerplate code" and to bring different aspects of game production into a single system. wikipedia
Even if you don't want to use XNA, I think these videos will help learn about the concepts and techniques common to most (if not all) game dev. Oh, and it's all C# :)
Good luck!
This link seems reasonable ( if a little verbose ) - it's takes you through how to code a simple tetris-like game in c# using GDI+. I has code listings and links to download the source code.
I would start with learn a little object oriented architecture - this is a key to your ultimate success.
Then learn how to design the model - the entities in the game (characters and etc) in code
and the view - the 2D representation of them, and how to connect the two (data and command binding).
I would try using WPF and not GDI+.
The code project has a lot of good articles for beginners.
I would take a look at SDL.Net it's a pretty good games library for .NET (well a binding to a good library for the pedants ;))
It has a lot of resources on its pages right from beginner stuff to more advanced things like isometric engines etc.
It doesn't seem to have been very active for a while however what is there already is more than enough for even complex 2D games.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Is there free OpenGL support libraries for C#? If so, which one do I use and where do I find sample projects?
Does C# provide classes for OpenGL?
OpenTK is an improvement over the Tao API, as it uses idiomatic C# style with overloading, strongly-typed enums, exceptions, and standard .NET types:
GL.Begin(BeginMode.Points);
GL.Color3(Color.Yellow);
GL.Vertex3(Vector3.Up);
as opposed to Tao which merely mirrors the C API:
Gl.glBegin(Gl.GL_POINTS); // double "gl" prefix
Gl.glColor3ub(255, 255, 0); // have to pass RGB values as separate args
Gl.glVertex3f(0, 1, 0); // explicit "f" qualifier
This makes for harder porting but is incredibly nice to use.
As a bonus it provides font rendering, texture loading, input handling, audio, math...
Update 18th January 2016: Today the OpenTK maintainer has stepped away from the project, leaving its future uncertain. The forums are filled with spam. The maintainer recommends moving to MonoGame or SDL2#.
Update 30th June 2020: OpenTK has had new maintainers for a while now and has an active discord community. So the previous recommendation of using another library isn't necessarily true.
I think what #korona meant was since it's just a C API, you can consume it from C# directly with a heck of a lot of typing like this:
[DllImport("opengl32")]
public static extern void glVertex3f(float x, float y, float z);
You unfortunately would need to do this for every single OpenGL function you call, and is basically what Tao has done for you.
Tao is supposed to be a nice framework.
From their site:
The Tao Framework for .NET is a collection of bindings to facilitate
cross-platform media application development utilizing
the .NET and Mono platforms.
SharpGL is a project that lets you use OpenGL in your Windows Forms or WPF applications.
You can OpenGL without a wrapper and use it natively in C#.
Just as Jeff Mc said, you would have to import all the functions you need with DllImport.
What he left out is having to create context before you can use any of the OpenGL functions. It's not hard, but there are few other not-so-intuitive DllImports that need to be done.
I have created an example C# project in VS2012 with almost the bare minimum necessary to get OpenGL running on Windows box. It only paints the window blue, but it should be enough to get you started. The example can be found at http://www.glinos-labs.org/?q=programming-opengl-csharp. Look for the No Wrapper example at the bottom.
I would also recommend the Tao Framework. But one additional note:
Take a look at these tutorials:
http://www.taumuon.co.uk/jabuka/
What would you like these support libraries to do? Just using OpenGL from C# is simple enough and does not require any additional libraries afaik.
Concerning the (somewhat off topic I know but since it was brought up earlier) XNA vs OpenGL choice, it might be beneficial in several cases to go with OpenGL instead of XNA (and in other XNA instead of OpenGL...).
If you are going to run the applications on Linux or Mac using Mono, it might be a good choice to go with OpenGL. Also, which isn't so widely known I think, if you have customers that are going to run your applications in a Citrix environment, then DirectX/Direct3D/XNA won't be as economical a choice as OpenGL. The reason for this is that OpenGL applications can be co-hosted on a lesser number of servers (due to performance issues a single server cannot host an infinite number of application instances) than DirectX/XNA applications which demands dedicated virtual servers to run in hardware accelerated mode. Other requirements exists like supported graphics cards etc but I will keep to the XNA vs OpenGL issue.
As an IT Architect, Software developer etc this will have to be considered before choosing between OpenGL and DirectX/XNA...
A side note is that WebGL is based on OpenGL ES3 afaik...
As a further note, these are not the only considerations, but they might make the choice easier for some...
XNA 2.0 requires a minimum of a shader 1.1 card. While old tech, not everyone has one. Some newer laptops (in our experience Toshiba tablets with Intel graphics) have no shader 1.1 support. XNA simply wont run on these machines.
This is a significant issue for us and we have shifted to Tao and OpenGL. Plus with Tao we have bindings for audio & Lua support.