1

In HOpenGL, I can enter fullscreen mode with the function fullScreen:

http://hackage.haskell.org/package/GLUT-2.1.1.2/docs/Graphics-UI-GLUT-Window.html#v%3AfullScreen

But, how can we leave the fullscreen mode? Is there a function to leave the fullscreen mode? I used the function fullScreenToogle but I get a runtime error:

user error (unknown GLUT call glutFullScreenToggle, check for freeglut)

2 Answers2

2

You will need to call setWindowSize :: Size -> IO () to exit full screen. This function internally calls glutReshapeWindow which leads to exit from full screen. See this answer.

Community
  • 1
  • 1
Ankur
  • 33,367
  • 2
  • 46
  • 72
  • Not in scope: `setWindowSize' I tried windowSize $= Size 640 480 without success: case key of ... Char 'F' -> fullScreen Char 'W' -> windowSize $= Size 640 480 _ -> return () – Juan Carlos Kuri Pinto Oct 11 '13 at 18:56
0

My answer to Ankur:

Not in scope: `setWindowSize'

I tried windowSize $= Size 640 480 without success:

case key of
 ...
 Char 'F' ->
  fullScreen
 Char 'W' ->
  windowSize $= Size 640 480
 _ -> return ()

I added this piece of code to this example:

KeyboardAndMouse3DAnimation.hs

http://pastebin.com/W14KSeLj