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

Author Topic: SFML and Windows Forms Application in VC C++  (Read 8762 times)

0 Members and 2 Guests are viewing this topic.

RichieDev

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML and Windows Forms Application in VC C++
« on: September 08, 2015, 11:03:13 pm »
Hi, i was looking solution for my problem but i couldn't find it so im writing here.

Im trying to make Map Editor for my 2D game and i would like to use SFML, C++ Visual Studio 2010 and Windows Forms.  I've read somewhere that i could just make component based on SFML and just put it on the form and start drawing.

My questions are:

1. Could anyone give me tutorial how to install SFML with .net (i guess i have to do that first before making sfml control in Windows Forms)?
I couldnt find fully tutorial how to do that. Should i just link Visual Studio C++ to SFML 2.2 and then just use SFML.net 2.2 .dll files?

2. After installing/linking correct SFML libraries how to use it in Windows Forms Application(as control that i can put on the form for example)?

Thanks! :)

Ztormi

  • Jr. Member
  • **
  • Posts: 71
  • Web developer by day. Game developer by night.
    • View Profile
Re: SFML and Windows Forms Application in VC C++
« Reply #1 on: September 09, 2015, 09:46:26 am »
As far as I know, MS dropped support of C++ Winforms after Visual Studio 2010, so I guess using it might not be a good idea.

So I'd suggest to drop the Winforms and use something else with C++ and SFML (like SFGUI or GTK). If you're familiar with both C++ and C# another option would be to write the map editor in C# Winforms with SFML.NET bindings and your game in C++ :)
« Last Edit: September 09, 2015, 09:48:45 am by Ztormi »

RichieDev

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML and Windows Forms Application in VC C++
« Reply #2 on: September 09, 2015, 12:16:19 pm »
Thanks for showing me SFML that will be very usefull, not only for my map editor :)
Anyway could you also tell me how to install SFML.net with Visual Studio 2010 C#?
I'd like to see if i will be able to make my map editor in C# Winforms and if not i'll just use SFML for that :P

@EDIT
SFGUI wont work for me ;/ I have no idea how to compile it even if im doing everything as tutorial says and i got no errors ;/
« Last Edit: September 09, 2015, 02:44:48 pm by RichieDev »

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: SFML and Windows Forms Application in VC C++
« Reply #3 on: September 09, 2015, 09:51:36 pm »
If you're going to use C# for the UI, might as well just get VS2015. You'll have to compile all of SFML's dependencies as well though, so VS2013 will work if you don't want to do that.
I haven't used SFML.NET, but if it's like any other C# library (I assume so), then it's pretty much plug and play...

RichieDev

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML and Windows Forms Application in VC C++
« Reply #4 on: September 10, 2015, 02:59:36 pm »
Thanks for help. I can see now that micro$hit software is useless.
You can close the topic, thanks for help again :)

Ztormi

  • Jr. Member
  • **
  • Posts: 71
  • Web developer by day. Game developer by night.
    • View Profile
Re: SFML and Windows Forms Application in VC C++
« Reply #5 on: September 11, 2015, 10:36:24 am »
If you're going to use C# for the UI, might as well just get VS2015. You'll have to compile all of SFML's dependencies as well though, so VS2013 will work if you don't want to do that.
You don't need to compile dependencies with SFML.NET as they are provided with the package.

Anyways basic setup goes like this:
Create project
Add folder called lib into project (contents of this folder are automatically copied to bin)
Copy all the dlls from package's extlib folder into project's lib folder
Right mouse click on project's references and add sfml.net dlls from package's lib folder.

« Last Edit: September 11, 2015, 10:45:52 am by Ztormi »