Why we use poll event function? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

Why we use poll event function?

What is poll event function and why we use it in game loop/main loop in SFML?

19th Aug 2021, 8:00 AM
K S Mirthun
K S Mirthun - avatar
2 Réponses
+ 2
Because the events get queued up internally and by calling pollEvent you'll get the top event of the queue https://www.sfml-dev.org/tutorials/2.5/window-events.php
19th Aug 2021, 12:47 PM
David García Prados
0
So we don't want to use this while we have only one event?🤔 Can we see the events that lined in the queues? 😅
20th Aug 2021, 3:51 AM
K S Mirthun
K S Mirthun - avatar