Code Monkey home page Code Monkey logo

Comments (5)

schell avatar schell commented on June 6, 2024

That means glfw-b failed to create a window/opengl context. I'd try to build and run the GLFW-b demo or start a new project with GLFW-b and try opening a new window.

The code that is err'ing in your situation is (from https://github.com/schell/gelatin/blob/master/gelatin-glfw/src/Gelatin/GLFW.hs#L25)

newWindow :: Int -- ^ Width
          -> Int -- ^ Height
          -> String -- ^ Title
          -> Maybe Monitor -- ^ The monitor to fullscreen into.
          -> Maybe Window -- ^ A window to share OpenGL contexts with.
          -> IO Window
newWindow ww wh ws mmon mwin = do
    defaultWindowHints
    windowHint $ WindowHint'OpenGLDebugContext True
    windowHint $ WindowHint'OpenGLProfile OpenGLProfile'Core
    windowHint $ WindowHint'OpenGLForwardCompat True
    windowHint $ WindowHint'ContextVersionMajor 3
    windowHint $ WindowHint'ContextVersionMinor 3
    windowHint $ WindowHint'DepthBits 16
    mwin' <- createWindow ww wh ws mmon mwin
    makeContextCurrent mwin'
    case mwin' of
        Nothing  -> do putStrLn "could not create window"
                       exitFailure
        Just win -> return win

Here we're setting some window hints that may not be compatible with your system. My guess is the OpenGL 3.3 hints are causing a problem - I'm not sure though. Please let me know if that helps.

from odin.

BartMassey avatar BartMassey commented on June 6, 2024

Huh. I got GLFW-b demo running by relaxing the constraints in its cabal file (which are very tight and won't allow it to install on my box AFAICT). After that I went back and rebuilt odin part-one, and it seems to work OK. it creates a very tall window, but that may have to do with my L-shaped dual monitor setup. So I guess I'm good. Sorry to bother you.

from odin.

schell avatar schell commented on June 6, 2024

You're not a bother at all, on the contrary - I enjoy talking about my projects and helping others get up and running!

This bug does seem peculiar though. About the long window, could it be that glfw doesn't know that one of your monitors is rotated 90 degrees?

from odin.

BartMassey avatar BartMassey commented on June 6, 2024

Yes, I believe that is what is happening. I'm going to guess that the failure to create the window earlier was somehow related to this also.

Now if I can just get my head around FRP we're all good. :-)

from odin.

schell avatar schell commented on June 6, 2024

@BartMassey totally - keep in mind there are lots of different types of FRP now. varying is arrowized, pull-based FRP and looks very different from libraries like reflex and reactive-banana. What helped me the most was reading the source of other libs and then writing my own ;) Start here and let me know if I can help. Also check out the #haskell and #haskell-game channels on IRC (irc.freenode.net).

from odin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.