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

Author Topic: Vector conversions in SFML.Net  (Read 3576 times)

0 Members and 1 Guest are viewing this topic.

Conduit

  • Newbie
  • *
  • Posts: 30
    • View Profile
Vector conversions in SFML.Net
« on: March 08, 2015, 11:09:57 pm »
I'm currently working on a project in SFML.Net, and was a little surprised upon noticing the vector constructors used to convert between vector types are not present. I feel like this is an unfortunate oversight, though I guess not a serious one. Adding the conversion constructors (or extension methods dealing with conversion) would be nice... though we'd only be hiding them, all the extra instantiations and casts are a little ugly. Adding conversions between Vector2* and the built-in Size structs in System.Drawing might be a useful consideration as well.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Vector conversions in SFML.Net
« Reply #1 on: March 08, 2015, 11:30:39 pm »
Sounds reasonable. Feel free to open an issue on the task tracker on Github, so that we don't forget this request.

And note that, strictly speaking, this section of the forum should be used for requests about the C++ API only, bindings are managed externally and thus should be discussed in the corresponding forum ;)
Laurent Gomila - SFML developer

Conduit

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Vector conversions in SFML.Net
« Reply #2 on: March 08, 2015, 11:34:35 pm »
Cool. Pretty likely I can code this myself if you guys need an assist, though I must admit I'm much more familiar with the C++ version of SFML (needed to abuse System.Reflection for this project).

Sorry about the misplaced post - feel free to migrate this thread, naturally.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Vector conversions in SFML.Net
« Reply #3 on: March 09, 2015, 12:50:49 am »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Conduit

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Vector conversions in SFML.Net
« Reply #4 on: March 09, 2015, 01:07:05 am »
Hmm... the conversion ops don't seem to be working for me, in that case. I did look for an existing alternative, though not in the source. If it's just some issue on my end (which it appears to be, given the time of that commit), I'll work it out.

Edit: Alright, I'm real lost now... The casts are not working for me, and VS's Object Browser doesn't show any casting operators in any of the Vector classes (see attached). Given the state of the GitHub codebase, it's possible that this is the result of an older version of the software being available on the "download" section of the website. Can anyone confirm this?

Edited edit: Cast works fine after recompiling the source on GitHub. Should I be worried at all about using the csfml libraries that come with the download on the main SFML site?

(This should probably be migrated to the appropriate "help" section)
« Last Edit: March 09, 2015, 03:50:23 am by Conduit »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Vector conversions in SFML.Net
« Reply #5 on: March 09, 2015, 04:25:29 am »
Edit: Alright, I'm real lost now... The casts are not working for me, and VS's Object Browser doesn't show any casting operators in any of the Vector classes (see attached). Given the state of the GitHub codebase, it's possible that this is the result of an older version of the software being available on the "download" section of the website. Can anyone confirm this?

If you had checked the commit I linked where it was added you could have seen it came after the 2.1 tag.  ;)

Quote
Edited edit: Cast works fine after recompiling the source on GitHub. Should I be worried at all about using the csfml libraries that come with the download on the main SFML site?

Well... if you are using the latest master and 2.1 copy CSFML you may run into issues due to several ABI changes. So either recompile the latest CSFML or wait for 2.2 packages to be put on the site (should happen soon as I am just waiting on eXpl0it3r to put them there).
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor