Hey all,
Recently started messing around with 2.0. I understand this is still a WIP, but I still thought I'd point out a few problems I'm having. First of all, I seem to be unable to draw any kind of shape or text whatsoever. This code, which works in 1.5:
using System;
using SFML.Window;
using SFML.Graphics;
namespace Project2
{
class Program
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500, 32), "Project2");
app.Closed += new EventHandler(OnClosed);
while (app.IsOpened())
{
app.DispatchEvents();
app.Clear();
app.Draw(Shape.Rectangle(new Vector2(0, 0), new Vector2(250, 250), Color.White));
app.Display();
}
}
static void OnClosed(object sender, EventArgs e)
{
((Window)sender).Close();
}
}
}
Doesn't work in 2.0 (that's copied and pasted). There was probably a change of some sort, but I can't get any Shape or Text to draw.
Second of all, whenever I draw a Text object, the application will crash on closing.
using System;
using SFML.Window;
using SFML.Graphics;
namespace Project2
{
class Program
{
static void Main()
{
RenderWindow app = new RenderWindow(new VideoMode(500, 500, 32), "Project2");
app.Closed += new EventHandler(OnClosed);
Text t = new Text("afafee");
while (app.IsOpened())
{
app.DispatchEvents();
app.Clear();
app.Draw(Shape.Rectangle(new Vector2(0, 0), new Vector2(250, 250), Color.White));
app.Draw(t);
app.Display();
}
}
static void OnClosed(object sender, EventArgs e)
{
((Window)sender).Close();
}
}
}
I think this is somehow related to SFML's RenderWindow.Close method because if I close directly the underlying system console window or exit the app by using "return" in Main, everything closes correctly. Maybe related to some cleanup done on closing?