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

Author Topic: VS2010 C#/.NET and SFML 2.0  (Read 10530 times)

0 Members and 1 Guest are viewing this topic.

Kalnos

  • Newbie
  • *
  • Posts: 8
    • View Profile
VS2010 C#/.NET and SFML 2.0
« on: February 13, 2011, 06:45:11 am »
So, I'm following the tutorial to setup SFML 2.0 using Cmake, and I'm unsure how I should continue at the point in which you would normally open the VS 2010 C++ command prompt to configure and use the >cmake command.  The thing is, as far as I know, the C# version doesn't have a command prompt  :? ?

Does anyone have any advice on how I can get this setup?  Also, just to check, is .NET supported for SFML 2.0 at this point, or am I jumping the gun?

Thanks for any help.  :)

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
VS2010 C#/.NET and SFML 2.0
« Reply #1 on: February 13, 2011, 07:40:55 am »
A Google search gave this command:

Code: [Select]
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

Kalnos

  • Newbie
  • *
  • Posts: 8
    • View Profile
VS2010 C#/.NET and SFML 2.0
« Reply #2 on: February 13, 2011, 08:06:53 am »
Quote from: "bastien"
A Google search gave this command:

Code: [Select]
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86


Hey!  I found a command very similar to that earlier, and by mixing the two I have gotten it to work.  Thanks!

I can generate the files with the Visual Studio 2010 option, but it creates a C++ solution, so I'm now just wondering if .NET isn't supported at the moment, or if I'm missing something.

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
VS2010 C#/.NET and SFML 2.0
« Reply #3 on: February 13, 2011, 09:15:53 am »
The source is there in bindings/dotnet, but I don't know if has updated for SFML 2.
It's also not configured to be compiled by CMake (maybe CMake doesn't support it?).
I can't really help you since I've never used this binding.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VS2010 C#/.NET and SFML 2.0
« Reply #4 on: February 13, 2011, 09:50:01 am »
Well, The .Net binding is based on the C binding which requires the C++ libraries. So you have to build all this stuff, SFML.Net is not written from scratch in pure C# ;)

However the C libraries are provided in dotnet/extlibs, so if they are not outdated you should be able to use them directly :D

To build SFML.Net, open the VS solution in bindings/dotnet/build and compile. It's a 2008 solution but it should convert fine to 2010.
Laurent Gomila - SFML developer

Kalnos

  • Newbie
  • *
  • Posts: 8
    • View Profile
VS2010 C#/.NET and SFML 2.0
« Reply #5 on: February 13, 2011, 07:38:07 pm »
Quote from: "Laurent"
Well, The .Net binding is based on the C binding which requires the C++ libraries. So you have to build all this stuff, SFML.Net is not written from scratch in pure C# ;)

However the C libraries are provided in dotnet/extlibs, so if they are not outdated you should be able to use them directly :D

To build SFML.Net, open the VS solution in bindings/dotnet/build and compile. It's a 2008 solution but it should convert fine to 2010.


Awesome, Laurent.  That worked, and I've nearly got it to run correctly!  I got the solution to open; had to download and set a reference to the Tao framework, and I'm nearly there, hopefully.

I made a test project, defined a Main() and I'm simply trying to open a window and I'm getting a "Unable to load DLL 'csfml-graphics-2'" missing .dll error.

In my lib folder under branches/sfml there is a sfmlnet-graphics-2 .dll, is it simply a case of mismatched file names, or something else?

Thanks!

8)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VS2010 C#/.NET and SFML 2.0
« Reply #6 on: February 13, 2011, 07:48:16 pm »
No, you really need the CSFML DLLs to run your application (remember, I said that SFML.Net was based on CSFML). The DLLs are in dotnet/extlibs and you have to copy them together with your SFML.Net DLLs.
Laurent Gomila - SFML developer

Kalnos

  • Newbie
  • *
  • Posts: 8
    • View Profile
VS2010 C#/.NET and SFML 2.0
« Reply #7 on: February 13, 2011, 08:13:07 pm »
Quote from: "Laurent"
No, you really need the CSFML DLLs to run your application (remember, I said that SFML.Net was based on CSFML). The DLLs are in dotnet/extlibs and you have to copy them together with your SFML.Net DLLs.


I do have them in the same folder as the other .dll's, no dice.  I'm unable to add them as a reference through VS also, since they're C, although I don't think that's necessary.   :?:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VS2010 C#/.NET and SFML 2.0
« Reply #8 on: February 13, 2011, 08:37:03 pm »
You're right, this is not necessary. They just have to be accessible when SFML.Net tries to load them.

You may have multiple copies of your SFML.Net DLLs, make sure that you're referring to the right ones (they should be in your executable's directory).
Laurent Gomila - SFML developer

Kalnos

  • Newbie
  • *
  • Posts: 8
    • View Profile
VS2010 C#/.NET and SFML 2.0
« Reply #9 on: February 13, 2011, 09:42:11 pm »
Quote from: "Laurent"
You're right, this is not necessary. They just have to be accessible when SFML.Net tries to load them.

You may have multiple copies of your SFML.Net DLLs, make sure that you're referring to the right ones (they should be in your executable's directory).




So yeah, I'm having some sort of post-XNA syndrome.  I've just gotten out of the habit of doing things in the executables directory.  For example, while trying to load that image I forgot that I just needed to add it to the same directory as the .exe, and that I'm not using a content pipeline.

Anyways, thanks a lot Laurent, it's pretty crazy to have a single-developer that's so active in helping people on the forums while developing. :)

Also, I apologize if the image size on that screen-shot is ridiculous, this monitor is 2560x1440 so I try to adjust them before posting.  8)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VS2010 C#/.NET and SFML 2.0
« Reply #10 on: February 13, 2011, 10:55:19 pm »
I'm glad everything works for you :)
Laurent Gomila - SFML developer

P@u1

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
VS2010 C#/.NET and SFML 2.0
« Reply #11 on: September 04, 2011, 07:04:29 pm »
I also want to test sfml 2.0 for .NET
Just downloaded the latest repo snapshot.
I recognized that the bindings folder is not there anymore (I know it was threre in an earlier version).
How can I get sfml 2.0 for .NET working?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
VS2010 C#/.NET and SFML 2.0
« Reply #12 on: September 04, 2011, 07:08:33 pm »
All bindings were moved to it's own repo. Here's .NET

https://github.com/SFML/SFML.Net
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

P@u1

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
VS2010 C#/.NET and SFML 2.0
« Reply #13 on: September 04, 2011, 07:12:27 pm »
thx, I will try to get it running now.
Btw I see audio, window and graphics.
Where is system and network?
And is the .Net version up to date, or are recent features missing?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
VS2010 C#/.NET and SFML 2.0
« Reply #14 on: September 04, 2011, 07:15:05 pm »
.NET is up to date. Those modules is not there because .NET standard library provides that functionality already.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio