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

Author Topic: Help with understanding the tutorials  (Read 1767 times)

0 Members and 1 Guest are viewing this topic.

Geoffry_the_Deprogrammer

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Help with understanding the tutorials
« on: October 26, 2014, 12:47:18 am »
Im attemting to use SFML in C# (because windows 8 cant run XNA) however because of this the tutorials are difficult to understand as i have no experience in C++, most of all, all the tutorials refer to "sf::" what does this actually mean, and is there a similar method i could use instead...?

UglyIgloo

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Help with understanding the tutorials
« Reply #1 on: October 26, 2014, 02:09:10 am »
Hi.


You'll have to be a little more descriptive in your post. I don't know C#, but I do know that it uses standard programming syntax as seen in most mainstream programming languages. (Java, C++, C#, etc.)


sf:: is a namespace to SFML, which means that it holds a variety of classes and functions that the SFML library uses. You could call "using" at the head of your file instead of calling the namespace, but I wouldn't recommend it, considering namespaces are convenient for creating new functions with similar names.

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: Help with understanding the tutorials
« Reply #2 on: October 26, 2014, 03:45:02 am »
UglyIgloo is right. Namespaces are a way to organize and separate functions, classes and other types and variables by putting them in their own named scope. If you do not understand namespaces I would strongly suggest brushing up on C++ or finding out what the equivalent is in C#. The tutorials are written for C++ since SFML was primarily a C++ library set a while back and has since grown to include iOS, Android and various other bindings.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Help with understanding the tutorials
« Reply #3 on: October 26, 2014, 09:37:15 am »

Long story short, sf::X maps to sf.X in C#. No need to know much more about C++ than that AFAIK.

You can find some example in C# here too (probably also in the SDK you downloaded, but I've never checked). https://github.com/SFML/SFML.Net/tree/master/examples
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Help with understanding the tutorials
« Reply #4 on: October 26, 2014, 11:12:47 am »
Quote
Long story short, sf::X maps to sf.X in C#.
Not exactly ;)

In C# the classes are under the namespaces SFML.System, SFML.Window, SFML.Graphics and SFML.Audio.
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Help with understanding the tutorials
« Reply #5 on: October 26, 2014, 11:20:03 am »
Well, I've learnt something today!  ;D
SFML / OS X developer