Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set OpenGL window hints in Gloss

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?

like image 223
NatureShade Avatar asked Oct 19 '22 08:10

NatureShade


1 Answers

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.

like image 146
ErikR Avatar answered Nov 10 '22 00:11

ErikR