module Irg.Lab3.Utility (
  GameState(..),
  MouseClicks,
  ReshapeCallback,
  DisplayCallback,
  KeyboardCallback,
  MouseCallback,
  getWindowSize
) where

--import qualified Graphics.GL.Compatibility33 as GL
import qualified Graphics.UI.GLUT as GLUT
import Data.IORef
import Linear.V4
-- import Irg.Lab3.Geometry.Shapes

getWindowSize :: Num a => IO (a, a)
getWindowSize = do
  GLUT.Size width height <- GLUT.get GLUT.windowSize
  return (fromIntegral width,fromIntegral height)

data GameState = GameState {
  polys :: [[V4 Float]]
} deriving (Eq)

type MouseClicks = IORef [(GLUT.GLfloat, GLUT.GLfloat)]
type ReshapeCallback = GameState -> GLUT.Size -> IO ()
type DisplayCallback = GameState -> Float -> IO ()
type KeyboardCallback = GameState -> Char -> GLUT.Position -> IO ()
type MouseCallback = GameState -> GLUT.MouseButton -> GLUT.KeyState -> GLUT.Position -> IO ()
