How to configure Gloss to use GLFW when using stack

169 views
Skip to first unread message

greg travis

unread,
Aug 4, 2020, 7:29:37 PM8/4/20
to Haskell Gloss
I have a stack-based project that currently uses GLUT, and works fine, including in ghci.

I added this to my stack.yaml:

flags:
  gloss:
    GLFW: true
    GLUT: false

And ghci gives me this:

Symbol not found: _glosszm1zi13zi1zi1zm2SbZZzz2OFJmq7Y0azz9tdhW7_GraphicsziGlossziInternalsziInterfaceziBackendziGLUT_glutStateInit_closure

which looks like it's still trying to use GLUT. (I did a full rebuild.)

Running as regular executable, playIO just immediately returns.

Is there a way to configure Gloss to use GLFW, using stack?

Ben Lippmeier

unread,
Aug 4, 2020, 7:37:28 PM8/4/20
to haskel...@googlegroups.com, greg travis
Sadly, even in GLFW mode it still needs the GLUT library installed to draw the vector font. I’m not sure what the stack configuration is doing — for development I always use straight cabal.

Gloss doesn’t have a proper story about font handling. When I wrote the first version there wasn’t a Haskell binding for any of the standard font rendering libraries. Now there are libs like https://hackage.haskell.org/package/typograffiti but it says it needs OpenGL 3. Someone will need to put some dev time in before we can get fully off of GLUT.

Cheers,
Ben.


 


greg travis

unread,
Aug 5, 2020, 11:39:05 AM8/5/20
to Haskell Gloss
Thanks for the response! Looking at the commands stack is emitting, I suspect that the problem is that stack converts these flags to lowercase, which we don't want in this case. I'll have to figure out if that can be disabled in some way.

And thanks for the lead to typograffiti, I'll check it out.

Adrian Sieber

unread,
Jan 9, 2022, 2:42:34 PM1/9/22
to Haskell Gloss
I've just been playing around with this a little more and I got it working when using:

flags:
  gloss:
    glfw: true

Notice that there is no glut: false. When I add glut: false it does not work anymore!

Reply all
Reply to author
Forward
0 new messages