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

Author Topic: VC# 2010 & SFML.Net  (Read 7894 times)

0 Members and 1 Guest are viewing this topic.

Niall

  • Newbie
  • *
  • Posts: 18
    • View Profile
VC# 2010 & SFML.Net
« on: September 28, 2011, 03:24:31 pm »
Hi guys, I'm completely new to this and I'm having some trouble setting things up in Visual C# 2010.

I've downloaded the SFML.Net package from the SVN and I was under the impression that I was to add references in my project to the dlls in the /lib folder, ie sfml-graphics.dll etc. However this folder's completely empty, the only things I can see are the C bindings and I can't add them as references - including them in my folder's build directory doesn't seem to help much either.
I've tried downloading the old package from the website and setting that up but I couldn't get it to detect the csfml dlls in my project folder.

Would anybody be able to help me.. figure out what I'm doing wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VC# 2010 & SFML.Net
« Reply #1 on: September 28, 2011, 03:30:05 pm »
Quote
I've downloaded the SFML.Net package from the SVN and I was under the impression that I was to add references in my project to the dlls in the /lib folder, ie sfml-graphics.dll etc. However this folder's completely empty, the only things I can see are the C bindings

SVN (now Git) snapshots are development versions, there's no package and you have to recompile SFML.Net yourself (which is very easy).

Quote
I've tried downloading the old package from the website and setting that up but I couldn't get it to detect the csfml dlls in my project folder

What do you mean? What error do you get?
Laurent Gomila - SFML developer

Niall

  • Newbie
  • *
  • Posts: 18
    • View Profile
VC# 2010 & SFML.Net
« Reply #2 on: September 28, 2011, 05:13:42 pm »
Well I've added the dlls from the lib folder from the site into the project references, and I've moved the csfml-audio, csfml-graphics etc into the same folder as my Program.cs and when I run the code provided in the documentation example the first error I get is this:

DllNotFoundException was unhandled
Unable to load 'csfml-graphics': The specified module could not be found.

at the line "RenderWindow app = new RenderWindow(new VideoMode(800, 600), "SFML window");"

Also, I'm not exactly sure how to recompile SFML.net myself, but is it a better idea if the git files are more up to date?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VC# 2010 & SFML.Net
« Reply #3 on: September 28, 2011, 05:33:24 pm »
Quote
I've added the dlls from the lib folder from the site into the project references, and I've moved the csfml-audio, csfml-graphics etc into the same folder as my Program.cs

It's the OS that looks for these DLLs when you launch your application, so it doesn't help at all to copy them to the same directory as your source code ;)
You must copy them in the same directory as the executable.

Quote
Also, I'm not exactly sure how to recompile SFML.net myself

Open the Visual Studio solution (.sln), choose your configuration (Debug/Release) and target architecture (x86/x64) and... click on the "Compile" button. Just like you do with your own project.

Quote
but is it a better idea if the git files are more up to date?

The current development version is SFML 2, a lot of things have changed since SFML 1.6.
Laurent Gomila - SFML developer

Niall

  • Newbie
  • *
  • Posts: 18
    • View Profile
VC# 2010 & SFML.Net
« Reply #4 on: September 28, 2011, 06:13:44 pm »
Managed to get it working! Thanks Laurent!

Right now I'm using 1.6, but all I have to do now is install Tao and then I'll be able to build SFML 2.

Niall

  • Newbie
  • *
  • Posts: 18
    • View Profile
VC# 2010 & SFML.Net
« Reply #5 on: September 28, 2011, 09:44:15 pm »
..Hmm. Apologies for the double-post, but I'm having some trouble with Tao. I've installed Microsoft .NET Framework 1.1 and used the Tao installer and got everything set up, however I'm still getting the "type or namespace name 'Tao' could not be found" errors. I've tried adding references to the opengl project for Tao.OpenGL.dll however that's not helping.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VC# 2010 & SFML.Net
« Reply #6 on: September 28, 2011, 09:51:11 pm »
Tao is only required to compile the examples, you don't need it in order to compile and use SFML.
Laurent Gomila - SFML developer

Niall

  • Newbie
  • *
  • Posts: 18
    • View Profile
VC# 2010 & SFML.Net
« Reply #7 on: September 29, 2011, 01:34:45 pm »
Ah, didn't realise. I removed the example projects from the solution and managed to build it all successfully! Thanks again (:

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
VC# 2010 & SFML.Net
« Reply #8 on: October 13, 2011, 11:22:52 am »
Hello

I would like to make a game using SFML. I've been told that I should not use C++ if I'm not experienced in using this language. I've been suggested to use C# instead, as it has better standard libraries and debugging. I wonder if you could assist me with the following:

1. What functionalities of the C++ SFML have been left out in SFML.NET? Is the network package present? If not, is it still possible to make an online game using SFML.NET?

2. Should I use VS2010 or is Monodevelop OK as well? I prefer Monodevelop as it is a multiplatform IDE so it would be easier for me to compile the game on different platforms. Moreover, monodevelop is more lightweight.

3. I tried compiling SFML.NET from github using monodevelop and it doesn't work. Maybe it's because I've been using the VS2010 solution file. Any suggestions?

4. I've heard about XNA. For anyone who ever used both SFML and XNA, how would you compare these two libraries in terms of ease of use? I understand that using XNA would limit my game to be Windows-only?

Thanks for your help!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
VC# 2010 & SFML.Net
« Reply #9 on: October 13, 2011, 11:33:21 am »
Why didn't you create a new topic??

Quote
1. What functionalities of the C++ SFML have been left out in SFML.NET?

sfml-system and sfml-network have been left out, because similar (and even better) features are provided by the .Net framework.

Quote
2. Should I use VS2010 or is Monodevelop OK as well? I prefer Monodevelop as it is a multiplatform IDE so it would be easier for me to compile the game on different platforms. Moreover, monodevelop is more lightweight.

MonoDevelop should be ok, SFML is a standard .Net assembly.

Quote
3. I tried compiling SFML.NET from github using monodevelop and it doesn't work.

Please provide more details about the error(s).
Laurent Gomila - SFML developer

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
VC# 2010 & SFML.Net
« Reply #10 on: October 13, 2011, 08:02:21 pm »
Hi Laurent! :)



I downloaded SFML.net from https://github.com/SFML/SFML.Net



(BTW it's not that easy to find as it's not linked anywhere!)



Then I open the solution in Monodevelop 2.8



When it tried compiling, there was an error with missing Tao, so I installed Tao and added it to references. After that it compiled itself without any errors. But it's very strange as the whole SFML.net solution compiled itself in 2 seconds and the output libraries are like 35 KB in size. Is that because they are bindings?



Also, when I run any of the examples, a window apprears "Program window.exe stopped working".



EDIT: OK, i copied all the files in Extlibs folder into the executable folder and now everything runs fine. It's been a long time since I used SFML, I can see that what used to be called IMAGE is now called TEXTURE. I'm missing some docs. Can I find any SFML.net documentation? I think the monodevelop didn't generate any doc for me, as the doc folder contains only some sample code.



Also, in the example there are some bits of code that I don't understand, like:



Code: [Select]
RenderWindow window = (RenderWindow)sender;

What does this line mean really? Thanks for help.

 

anything