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

Author Topic: First version released  (Read 11111 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
First version released
« on: August 28, 2008, 02:23:55 pm »
Hi

I've finished a first version of the .Net binding, available on SVN.

There's one annoying bug : it crashes randomly on internal objects destructions. I suspect the code is not completely GC-safe, but this is also the first time I write C# code (and .Net in general).

So, if someone can point out the mistake (I think it's located in the ObjectBase class), let me know :)

Any other bug report or suggestion is also welcome, as I'm not an expert in C#. Especially regaring C# standards / idioms / philosophy.

One last thing : if someone could test it under Mono, just to make sure everything's ok (AFAIK Mono doesn't fully implements .Net 2.0).
Laurent Gomila - SFML developer

Ed Ropple

  • Newbie
  • *
  • Posts: 3
    • AOL Instant Messenger - Blacken00100
    • View Profile
    • http://www.edropple.com
First version released
« Reply #1 on: September 01, 2008, 01:23:32 am »
Quote
There's one annoying bug : it crashes randomly on internal objects destructions. I suspect the code is not completely GC-safe, but this is also the first time I write C# code (and .Net in general).

So, if someone can point out the mistake (I think it's located in the ObjectBase class), let me know Smile
I haven't looked at the code yet, but if the bug occurs, you should be getting a stack trace and exception. Have a paste?

Quote
Any other bug report or suggestion is also welcome, as I'm not an expert in C#. Especially regaring C# standards / idioms / philosophy.
When I get some time I'll look, but you should probably keep in mind that it won't look all that much like the C++ version if we're trying to go with C# conventions. C# is a different (better, IMO--cleaner, more logical) beast.

Quote
One last thing : if someone could test it under Mono, just to make sure everything's ok (AFAIK Mono doesn't fully implements .Net 2.0).
They're in final release stages before Mono 2.0 comes out--in theory at least, they implement everything in the System namespace.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
First version released
« Reply #2 on: September 01, 2008, 09:44:10 am »
Quote
I haven't looked at the code yet, but if the bug occurs, you should be getting a stack trace and exception. Have a paste?

It's ok, we found the bug on the french forum : it's caused by the GC collecting resource classes (like Image, Font, ...) in its own thread, causing any OpenGL call happening in Dispose() to fail.

Quote
When I get some time I'll look, but you should probably keep in mind that it won't look all that much like the C++ version if we're trying to go with C# conventions. C# is a different (better, IMO--cleaner, more logical) beast.

I know, and I've tried to stick as much as possible to the C# conventions, but as I'm not used to them I may have missed something ;)

Quote
They're in final release stages before Mono 2.0 comes out--in theory at least, they implement everything in the System namespace.

So it should be ok, AFAIK the only thing I use from 2.0 is generic collections.
Laurent Gomila - SFML developer

vmilea

  • Newbie
  • *
  • Posts: 1
    • View Profile
First version released
« Reply #3 on: September 25, 2008, 04:23:16 pm »
Just noticed an X/Y mix-up in 'Vector2.cs':

operator-   : return new Vector2(v1.X - v2.X, v1.Y - v2.X);
operator+   : return new Vector2(v1.X + v2.X, v1.Y + v2.X);

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
First version released
« Reply #4 on: September 26, 2008, 02:46:44 pm »
Thanks, it's now fixed.

Apart from that, did you test this binding ? Do you have any other good or bad feedback ? :)
Laurent Gomila - SFML developer

phenex

  • Newbie
  • *
  • Posts: 2
    • View Profile
First version released
« Reply #5 on: January 15, 2009, 08:30:34 am »
I went through the French forum (I don't speak French), and I didn't find this bug mentioned. Hopefully this is news to you.

It seems that there is a problem with String2D.GetRect. I was able to get it to work (as far as I can tell) by changing GetRect to:

Code: [Select]
public FloatRect GetRect()
{
return (FloatRect)Marshal.PtrToStructure(sfString_GetRect(This), typeof(FloatRect));
}


I'll be fixing any bugs I can find as I go through it. Thanks for the wrapper.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
First version released
« Reply #6 on: January 15, 2009, 10:01:28 pm »
I can't see the difference between your code and mine (you're just using the other overload of the function, which does exactly the same thing). Can you explain what was wrong? :)
Laurent Gomila - SFML developer

phenex

  • Newbie
  • *
  • Posts: 2
    • View Profile
First version released
« Reply #7 on: January 15, 2009, 11:43:00 pm »
Was the previous version of GetRect working for you? It was not working for me. It would throw an ArgumentException inside GetRect, on the PtrToStructure call, indicating that Rect should not be a value class.

This version works for me. It creates the structure for you, so you don't need any code inside GetRect except that which I've already pasted.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
First version released
« Reply #8 on: January 18, 2009, 12:46:07 pm »
I still don't know why the first version didn't work, but I fixed it using your code.

Thanks :)
Laurent Gomila - SFML developer

Beliar

  • Newbie
  • *
  • Posts: 27
    • View Profile
First version released
« Reply #9 on: January 18, 2009, 02:13:04 pm »
RenderWindow.ConvertCoords(uint windowX, uint windowY) throws an NullReferenceException when no View has been set.

The easy way to fix it is to add
Code: [Select]

CurrentView = myDefaultView;

in the Initialize metehod.

Another (maybe better) way is to change RenderWindow.ConvertCoords(uint windowX, uint windowY) to this:
Code: [Select]

return ConvertCoords(windowX, windowY, CurrentView);


and the Getter of CurrentView:

Code: [Select]

get {
if(myCurrentView != null)
{
return myCurrentView;
}
else
{
return DefaultView;
}
}


Edit:
Oh and i tested it with Mono.
It compiles and runs without problems on windows.
It compiles and runs on Linux but i had problems which maybe are cause i used the VMWare image from the Mono website. Don't have any other Linux installed currently though.
Debuggers don't remove bugs. They only show them in slow motion.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
First version released
« Reply #10 on: January 18, 2009, 07:14:03 pm »
It's fixed, thanks.

I'm also glad to see that it works fine with Mono :)
Laurent Gomila - SFML developer

 

anything