You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to figure out why I am getting spurious events when I run the GLFW-b-demo. The issue seems to be with GLFW-b. But, I am not sure about it and hence want to get some expert opinion about it.
With this patch to the Main.hs, I am expecting the message "received GLFW event" to be fired only when there is an actual event.
git diff
diff --git a/src/Main.hs b/src/Main.hs
index 89799f4..fcb2b56 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -210,7 +210,9 @@ run = do
liftIO $ do
GLFW.swapBuffers win
GL.flush -- not necessary, but someone recommended it
- GLFW.pollEvents
+-- GLFW.pollEvents
+ GLFW.waitEvents
+ liftIO (putStrLn "received GLFW event")
processEvents
state <- get
But, for some reason, I keep getting the message "received GLFW event" almost as if it is running in an endless loop. I tested the events behaviour using the tests/events.c of the glfw github master branch and it works fine.
TMPDIR=/tmp/ghc stack exec GLFW-b-demo
------------------------------------------------------------
'?': Print these instructions
'i': Print GLFW information
* Mouse cursor, keyboard cursor keys, and/or joystick
control rotation.
* Mouse scroll wheel controls distance from scene.
------------------------------------------------------------
received GLFW event
window refresh:
window iconify: IconifyState'NotIconified
framebuffer size: 836 513
window size: 836 513
window pos: 0 17
window iconify: IconifyState'NotIconified
window focus: FocusState'Focused
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
key: Key'X 53 KeyState'Pressed [mod keys: none]
char: 'q'
key: Key'X 53 KeyState'Released [mod keys: none]
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
received GLFW event
key: Key'Escape 9 KeyState'Pressed [mod keys: none]
GLFW-b-demo: <stdout>: commitBuffer: invalid argument (Bad file descriptor)
-
Thanks
The text was updated successfully, but these errors were encountered:
Thanks for reporting, I'm trying to trace this, from know I just have several thoughts of what It could be. I will post the updates I have made if they lead me to any conclusions. But indeed it could be something.
Hello,
Thanks for sharing the GLFW-b.
I am trying to figure out why I am getting spurious events when I run the GLFW-b-demo. The issue seems to be with GLFW-b. But, I am not sure about it and hence want to get some expert opinion about it.
With this patch to the Main.hs, I am expecting the message "received GLFW event" to be fired only when there is an actual event.
But, for some reason, I keep getting the message "received GLFW event" almost as if it is running in an endless loop. I tested the events behaviour using the tests/events.c of the glfw github master branch and it works fine.
Thanks
The text was updated successfully, but these errors were encountered: