Hardcoded call to GLUT in platform agnostic code? (GLUT.renderString)

18 views
Skip to first unread message

Jørn Lode

unread,
Sep 22, 2022, 6:14:38 AM9/22/22
to Haskell Gloss
Hi, I'm trying to use Gloss with the GLFW backend (in order to avoid the ghci crash). It crashes whenever I try to render text, with the error that glutStrokeCharacter is called before glutInit. Well, glutInit is obviously never called, because I'm not using that backend, so the call to glutStrokeCharacter should probably also never happen.

The offending line is probably this one:

Edit: Upon further investigation, this (using glutStrokeCharacter without glutInit) seems to be supported in GLUT, but not in freeglut. So I guess the question is whether to support use of freeglut.

Ben Lippmeier

unread,
Sep 22, 2022, 6:37:11 AM9/22/22
to haskel...@googlegroups.com, Jørn Lode
With the GLFW backend for window management we still rely on GLUT for drawing text, as there is now an equivalent in GLFW. We’ve wanted to do something better for text rendering for a long time..

Ben.


Jørn Lode

unread,
Sep 26, 2022, 4:24:06 AM9/26/22
to Haskell Gloss
Thanks for the reply. :) I noticed that the source code is quite easy to navigate, and that these decisions are nicely documented in source code comments.

I just made a fork which uses freeGLUT features that allow me to exit cleanly, which allows me to use gloss with ghci. I don't know if GLUT is used on any platforms anymore? Maybe OSX?

-Jørn
Reply all
Reply to author
Forward
0 new messages