SFML community forums
Bindings - other languages => DotNet => Topic started by: Gonzilla on May 10, 2012, 10:20:33 pm
-
Image img
= new Image
(0,
0); //crash without any error messageImage img
= new Image
(0,
0, Color
.Red); //crash without any error messageImage img
= new Image
(0,
0,
null); //working
-
It's fixed, thanks.
-
Also I found a bug in the Image class.
var colors
= new Color
[2,
2];colors
[0,
0] = Color
.Red;colors
[0,
1] = Color
.Yellow;colors
[1,
0] = Color
.Green;colors
[1,
1] = Color
.Black;var image
= new Image
(colors
);//Workingvar pixel
= image
.GetPixel(0,
1);//Crash without any message because it's out of boundvar pixel2
= image
.GetPixel(0,
2);//Workingimage
.SetPixel(0,
1, Color
.White);//Crash without any message because it's out of boundimage
.SetPixel(0,
2, Color
.White);
-
Yep, SFML doesn't check out of bounds access.
This behaviour is ok for C++, but maybe I should handle it in SFML.Net, and throw an exception instead?
-
Yes please. In .NET every exception is nicer than an immediate close/crash of the application ;)