SFML community forums
Bindings - other languages => DotNet => Topic started by: Spodi on May 26, 2010, 01:35:21 am
-
I am not positive on this one, but it looks like the structs in Event.cs used inside of the Event struct (SizeEvent, JoyButtonEvent, etc) should have the StructLayout(LayoutKind.Sequential) attribute.
-
Maybe, honestly I don't know .Net enough to have an opinion about this. But so far it have always worked like a charm.
-
Since the Event struct is going between managed and unmanaged, and these structs are inside of that Event struct, I am quite sure that they are needed. I haven't had a problem with it, either, but its always better to be safe than sorry. In general, any struct you use for managed code should have the struct layout type not automatic since you never know what the compiler (or JIT) is going to do. Its always nice to have for reflection, too. ;)
So my opinion is add it just to be safe.
-
Yep, I agree. I'll do that as soon as possible, thanks.
-
Done.