Reputation: 707
Profiling options aren't working with gloss, even though gloss was installed with library profiling enabled in ~/.cabal/config
,
Example: Test.hs
import Graphics.Gloss
main = display (InWindow "test" (800, 600) (200, 200)) black blank
Compiling and running:
$ ghc Test.hs
[1 of 1] Compiling Test ( Test.hs, Test.o )
Linking Test ...
$ ./Test +RTS -s
I then close the window with window's x button, but there isn't any gc output.
If I change Test.hs to main = print "test"
and repeat the steps, it outputs some garbage collection related info, which is what should be happening.
Upvotes: 2
Views: 122
Reputation: 63
When profiling with Graphics.Gloss, you will need to explicitly handle the end of the program in your code. You might want to hardcode a timeout for the animation, or catch some keyboard input and manually end the program (using something as simple as unsafePerformIO exitSuccess
).
The actionOnwindowClose
seems to be on the wishlist of the gloss devs, but is not working at the moment (https://github.com/benl23x5/gloss/blob/b41f867ffb6c05a40f778a29f99933b603c11a31/gloss/Graphics/Gloss/Internals/Interface/Backend/GLUT.hs#L61)
Upvotes: 0