I am looking into the gloss library and as any sane person I am quite irritated by the lack of anti-aliasing. I know some OpenGL window hints that help enabling anti-aliasing, especially the GL.lineSmooth
hint. However looking through the Gloss haddock docs there doesn't seem to be any obvious way to set OpenGL hints. So how would I go forward doing this?
Asked
Active
Viewed 327 times
5

NatureShade
- 2,187
- 1
- 19
- 27
-
You might have a look at the [`gl`](https://hackage.haskell.org/package/gl) library - supposedly it is a _complete_ set of OpenGL raw bindings. – ErikR May 29 '16 at 21:01
-
Yes, I know about it, but not how to change the Gloss OpenGL initialization code. – NatureShade May 29 '16 at 21:31
1 Answers
3
Here's the best I can figure out...
gloss
abstracts graphics backends via the class Backend
type class, and there are two instances defined:
instance Backend GLFWState
instance Backend GLUTState
Which one is used is controlled at compile time via the WITHGLUT
and WITHGLFW
CPP macros.
This explains why gloss doesn't provide functions to customize the GL setup - as far as it is concerned the backend is abstract.
The initialization code for the GLUT backend is in the initializeGLUT
function in Graphics/Gloss/Internals/Interface/Backend/GLUT.hs
Perhaps you can modify that routine to set up GLUT they way you want to obtain a custom version of gloss.

ErikR
- 51,541
- 9
- 73
- 124
-
Heh. Here we have a library that abstracts out two other libraries whose only purpose is to abstract out several other libraries. – user253751 May 30 '16 at 01:21
-
Yes, the simplest option seems like to modify the `initialize` function and compile gloss manually. I will give it a try when I get home. – NatureShade May 30 '16 at 06:11