Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML: C# or C++?  (Read 8691 times)

0 Members and 1 Guest are viewing this topic.

AbelToy

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • AbelToy.com
    • Email
SFML: C# or C++?
« on: January 30, 2014, 06:27:14 pm »
Hello everyone,

I'm an experienced AS3 programmer (one of the main guys at FlashPunk), and have also worked quite a bit with C#, Python, Ruby, the web languages, etc.

I'm undecided between choosing the .NET version of SFML or the C++ one, and I was wondering if you guys could help me a bit.

The pros of using the C++ version would be that most of the libraries for SFML are only available in C++. Also, it's faster. But I have never used C++, and I would have to learn the language first. (and the C++11 techniques).

The pros of using the C# version is I already know the language, and I love the additional features it has to offer compared to C++. The disadvantage would be less speed and much less library support. I would have to port the libraries (or make bindings, but I've got no idea about that).

My questions are: is SFML.Net as portable as SFML C++? With that I mean, can I use the C# version to make Mac and Linux versions of my game that would run well? Is Mono fast and good? Could I also use the SFML.net mobile version once finished with my C# code?

Would I be able to easily integrate the Steam API into a C# game? I know the official Steam API is only C++, but I've seen a paid library that brings C# to the API and it's very easy and fun.

What problems would I run into using the C# version instead of the C++ version?

Also, as an aside question... does Java really work for games? I've heard about the cool libgdx library... but I've always seen Java apps perform poorly, and they all have some sort of Java feeling.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: SFML: C# or C++?
« Reply #1 on: January 30, 2014, 06:33:32 pm »
Choose whatever you like, but know that if you avoid OS specific namespaces of the .NET framework it is very portable to mono (and the number of these OS specific namespaces is very small you won't even touch them for game dev).

See more of my answer here.


Quote
I would have to port the libraries (or make bindings, but I've got no idea about that).

Depending on what you are after I have ported Thor to SFML.NET (see NetEXT in my signature), and you can PM for more information on making bindings if you are interested in that route.  ;)

Quote
Could I also use the SFML.net mobile version once finished with my C# code?

There is currently a test version of SFML for andriod/ios, but it is unfinished and as for coming to SFML.NET I doubt it will happen.  :P
« Last Edit: January 30, 2014, 06:41:58 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML: C# or C++?
« Reply #2 on: January 30, 2014, 06:43:51 pm »
You should be aware that C++ is an extremely complex language. Even when you already know a language like C#, it will take months until you have properly learned the basics, and possibly years until you know how to write clean, idiomatic code (although this can be accelerated if you read the right books from the beginning). Never underestimate C++ ;)

If you already know C#, I would recommend the SFML.NET binding. zsbzsb even ported my C++ library Thor to C# as NetEXT 8)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

AbelToy

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • AbelToy.com
    • Email
Re: SFML: C# or C++?
« Reply #3 on: January 30, 2014, 06:51:16 pm »
Quote
I would have to port the libraries (or make bindings, but I've got no idea about that).

Depending on what you are after I have ported Thor to SFML.NET (see NetEXT in my signature), and you can PM for more information on making bindings if you are interested in that route.  ;)

Oooooh. Shiny! Cool, one less thing to worry about :D

Quote
Could I also use the SFML.net mobile version once finished with my C# code?

There is currently a test version of SFML for andriod/ios, but it is unfinished and as for coming to SFML.NET I doubt it will happen.  :P

Damn. Ok. I guess I'll have to make a port for mobile. Not a problem.

You should be aware that C++ is an extremely complex language. Even when you already know a language like C#, it will take months until you have properly learned the basics, and possibly years until you know how to write clean, idiomatic code (although this can be accelerated if you read the right books from the beginning). Never underestimate C++ ;)

If you already know C#, I would recommend the SFML.NET binding. zsbzsb even ported my C++ library Thor to C# as NetEXT 8)

Yeah, I know C++ is extremely complex. That's why I want to check I can use C#. I want to eventually learn C++, but I need to do this project now, and I was checking if there's any possibility I can avoid using C++ at the moment. I know how it is learning how to properly write for a language.

Thank you guys for the quick responses!