I've been looking at some of the examples, and putting together a skeleton application. I'm using version 1.6 of the .NET bindings.
In this page:
http://www.sfml-dev.org/tutorials/1.6/window-events.php the events are handled with GetEvent in the loop:
sf::Event Event;
while (App.GetEvent(Event))
{
// Window closed
if (Event.Type == sf::Event::Closed)
Running = false;
}
but the sample code, see
https://github.com/SFML/SFML.Net/blob/master/examples/window/Window.cs uses DispatchEvents as GetEvent is protected now.
Is the tutorial just out of date? What is the recommended method?
Also, the event handlers such as:
static void OnClosed(object sender, EventArgs e)
{
Window window = (Window)sender;
window.Close();
}
require a cast on the sender. Is there no way to avoid this side-stepping the type system?