I think I'd like to learn a new library

Started by
6 comments, last by Fiddler 16 years, 2 months ago
In this post I talk about a game graphically similar to Stick Soldiers, i.e simple 2D vector art. All my personal projects have used C++ before because that's what I knew, but since I started the last project I've done a fair bit of work in Java, C# and Flex and am happy to work in any of them. I don't want to discuss the "best" language since they're all quite capable, but I would like to ask about which have good libraries available for sound, graphics and network functionality since I don't want to write any low-level code if possible. I believe SDL is actually available for many languages but is it as stable in them as it is in C++? I could just use C++ but I fancy a change.
Advertisement
What about XNA?
SDL is pretty stable in .NET using the Tao Framework or SDL.NET. I've used them both and I don't see any reason not to use either of them.
I've been using SDL with Ocaml and it works exactly the same.

I've also used it with Python (through PyGame), and that was also a good experience. Unlike most SDL bindings, however, PyGame makes some major changes to the interface.
So is SDL the recommended library for C#, like it tends to be for C++? Or is there some custom library for C#?

XNA is a possibility, if I go .NET. I'm probably going to pick either C# or ActionScript.
The Tao Framework is a good bet; Tao.Sdl will allow you to leverage your existing SDL knowledge.

Then, there's OpenTK, which is a native C# library (i.e. not bindings to a C library). You'll need to get used to .Net conventions to use it efficiently, but imho it's worth it in the end (your code will be much cleaner, without the C-isms).

Both of these will involve writing OpenGL code - if you don't want that, there's Agate, which sits on top of MDX/OpenTK and focuses on 2d rendering.

Last, there's XNA. It's backed by Microsoft, which means it has good docs and many samples online. On the other hand it also means it's Windows & XBox360 only, which you may, or may not make like if you are looking into making money.

My personal preference is OpenTK (obviously biased, since I'm it's creator :) ). Take your pick!

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

OpenTK sounds a little low-level, compared to SDL/XNA? Agate sounded interesting but it looks a little raw to rely on... do you have any comments on it?
Actually, OpenTK is a little higher level than SDL: it supports font rendering by default and has an integrated math toolkit (as in, you can pass vectors, matrices to OpenGL functions directly). The next version will also contain dds and wav loaders, and future versions will have ogg support, so it's closer to SDL + SDL_image + SDL_audio (?). You'd also need to take .Net into account, which has quite a lot of functionality over the standard C or C++ libraries.

XNA again is higher level than OpenTK, mainly due to the "content pipeline". It also integrates this functionality into Visual Studio in the form of Game Studio Express, which is a bonus.

Regarding Agate, I think it's quite well-designed. I'm not using it myself so I can't comment on its stability/features - it's probably best to check it out by whipping up a small demo/game (pong maybe?)

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

This topic is closed to new replies.

Advertisement