File: Environment.hs

package info (click to toggle)
haskell-gloss 1.13.2.2-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 344 kB
  • sloc: haskell: 2,903; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Graphics.Gloss.Interface.Environment where

import Data.IORef (newIORef)

import qualified Graphics.Gloss.Internals.Interface.Backend.Types as Backend.Types
import Graphics.Gloss.Internals.Interface.Backend (defaultBackendState)

-- | Get the size of the screen, in pixels.
--
--   This will be the size of the rendered gloss image when
--   fullscreen mode is enabled.
--
getScreenSize :: IO (Int, Int)
getScreenSize = do
       backendStateRef <- newIORef defaultBackendState
       Backend.Types.initializeBackend backendStateRef False
       Backend.Types.getScreenSize backendStateRef