SFML community forums

Bindings - other languages => DotNet => Topic started by: First on September 22, 2013, 01:03:58 pm

Title: Problem with Events
Post by: First on September 22, 2013, 01:03:58 pm
How to use events? I can not open a class waitEvent (pollevent). Already read everywhere and I can not find a way out. Help. I am writing in C #
Title: Re: Problem with Events
Post by: zsbzsb on September 22, 2013, 01:32:45 pm
You should learn to use your object browser, all class objects are laid out for easy reading of what you want. In the .NET binding there is no pollEvent on the RenderWindow, instead assign the event objects of the RenderWindow to a callback handler and do your event handling there. And in your game loop just call RenderWindow.DispatchEvents.
Title: Re: Problem with Events
Post by: First on September 22, 2013, 02:08:14 pm
you give an example? I can not understand how to work with events.
Title: Re: Problem with Events
Post by: zsbzsb on September 22, 2013, 02:54:49 pm
you give an example? I can not understand how to work with events.

What you need is not an example of how to work with just SFML events, but rather you need to learn how C# events and delegates work together. Take a look here (http://lmgtfy.com/?q=c%23+events+and+delegates) for a good number of articles where you can learn this.
Title: Re: Problem with Events
Post by: Laurent on September 22, 2013, 07:07:03 pm
SFML.Net is distributed with simple examples, take a look at them.