Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLFW error callback doesn't appear to work, at least during GLFW init time #6

Open
deepfire opened this issue Mar 14, 2017 · 0 comments
Labels

Comments

@deepfire
Copy link
Owner

deepfire commented Mar 14, 2017

As an example, the reflex-glfw-demo is incompatible with OpenGL 3.3, so changing withGLWindow like this:

withGLWindow width height title f = do
     liftIO $ GL.setErrorCallback $ Just simpleErrorPrinter
+    liftIO $ GL.defaultWindowHints
+    liftIO $ mapM_ GL.windowHint
+      [ GL.WindowHint'ContextVersionMajor 3
+      , GL.WindowHint'ContextVersionMinor 3
+      , GL.WindowHint'OpenGLProfile GL.OpenGLProfile'Core
+      , GL.WindowHint'OpenGLForwardCompat True ]
     m <- liftIO $ GL.createWindow width height title Nothing Nothing

makes the demo fail obscurely, without invoking the error callback:

[nix-shell:~/src/reflex-glfw]$ cabal build && dist/build/reflex-glfw-demo/reflex-glfw-demo
Building reflex-glfw-0.1.0.0...
Preprocessing library reflex-glfw-0.1.0.0...
[1 of 1] Compiling Reflex.GLFW      ( src/Reflex/GLFW.hs, dist/build/Reflex/GLFW.o )
Preprocessing executable 'reflex-glfw-demo' for reflex-glfw-0.1.0.0...
Linking dist/build/reflex-glfw-demo/reflex-glfw-demo ...
reflex-glfw-demo: Prelude.head: empty list

A similar failure to invoke the handler can be observed if one fails to run Reflex.GLFW.init -- the error message is produced by withGLWindow itself, not the simpleErrorPrinter handler that is set up by the time of its invocation.

It is a bit mysterious..

@deepfire deepfire added the bug label Mar 14, 2017
@deepfire deepfire changed the title GLFW error callback doesn't appear to work GLFW error callback doesn't appear to work, at least during GLFW init time Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant