main :: IO ()
main = withWindow 750 750 "Demo" $ \win -> do
  H.configGLState 0.125 0.125 0.125
  resources <- newIORef
           =<< loadResources "assets"

  -- setup event generators for core input (keys, mouse clicks, and elapsed time, etc.)
  (coreEvProc, evGens) <- glfwCoreEventGenerators win

  -- build and run the FRP network
  buildNetwork resources evGens

  forever $ do
    coreEvProc -- check the input buffers and generate FRP events

    GLFW.swapBuffers win -- present latest drawn frame
    H.clearDepth
    H.clearScreen

    focused <- GLFW.getWindowFocused win

    -- don't consume CPU when the window isn't focused
    unless focused (threadDelay 100000)
main :: IO ()
main = withWindow 750 750 "Demo" $ \win -> do
  H.configGLState 0.125 0.125 0.125
  resources <- newIORef
           =<< loadResources "assets"

  -- setup event generators for core input (keys, mouse clicks, and elapsed time, etc.)
  (coreEvProc, evGens) <- glfwCoreEventGenerators win

  -- build and run the FRP network
  buildNetwork resources evGens

  forever $ do
    coreEvProc -- check the input buffers and generate FRP events

    GLFW.swapBuffers win -- present latest drawn frame
    H.clearDepth
    H.clearScreen

    focused <- GLFW.getWindowFocused win

    -- don't consume CPU when the window isn't focused
    unless focused (threadDelay 100000)
main = withWindow 750 750 "Demo" $ \win -> do
  H.configGLState 0.125 0.125 0.125
  resources <- newIORef
           =<< loadResources "assets"

  -- setup event generators for core input (keys, mouse clicks, and elapsed time, etc.)
  (coreEvProc, evGens) <- glfwCoreEventGenerators win

  -- build and run the FRP network
  buildNetwork resources evGens

  forever $ do
    coreEvProc -- check the input buffers and generate FRP events

    GLFW.swapBuffers win -- present latest drawn frame
    H.clearDepth
    H.clearScreen

    focused <- GLFW.getWindowFocused win

    -- don't consume CPU when the window isn't focused
    unless focused (threadDelay 100000)