Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problem with Events  (Read 2170 times)

0 Members and 1 Guest are viewing this topic.

First

  • Newbie
  • *
  • Posts: 41
    • View Profile
    • Email
Problem with Events
« 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 #

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Problem with Events
« Reply #1 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.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

First

  • Newbie
  • *
  • Posts: 41
    • View Profile
    • Email
Re: Problem with Events
« Reply #2 on: September 22, 2013, 02:08:14 pm »
you give an example? I can not understand how to work with events.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Problem with Events
« Reply #3 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 for a good number of articles where you can learn this.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Problem with Events
« Reply #4 on: September 22, 2013, 07:07:03 pm »
SFML.Net is distributed with simple examples, take a look at them.
Laurent Gomila - SFML developer

 

anything