-- | Draws a cube or a cube wireframe dependending on the passed in
-- value.
drawCube :: Bool -- ^ If true, the cube is solid. Else, it's wireframe.
            -> IO ()
drawCube filled = do
  color $ Color3 1.0 0 (0 :: GLdouble)
  drawFace filled cubeSize

  mapM_ (const $ r q 1 0 0 >> drawFace filled cubeSize) [1 .. 3 :: Integer]

  r q 1 0 0
  r q 0 1 0
  drawFace filled cubeSize

  r f 0 1 0
  drawFace filled cubeSize

  where
    f, q :: GLfloat
    f = 180.0
    q = 90.0

    r :: GLfloat -> GLfloat -> GLfloat -> GLfloat -> IO ()
    r r' x y z = rotate r' $ Vector3 x y z
drawCube :: Bool -- ^ If true, the cube is solid. Else, it's wireframe.
            -> IO ()
drawCube filled = do
  color $ Color3 1.0 0 (0 :: GLdouble)
  drawFace filled cubeSize

  mapM_ (const $ r q 1 0 0 >> drawFace filled cubeSize) [1 .. 3 :: Integer]

  r q 1 0 0
  r q 0 1 0
  drawFace filled cubeSize

  r f 0 1 0
  drawFace filled cubeSize

  where
    f, q :: GLfloat
    f = 180.0
    q = 90.0

    r :: GLfloat -> GLfloat -> GLfloat -> GLfloat -> IO ()
    r r' x y z = rotate r' $ Vector3 x y z
drawCube filled = do
  color $ Color3 1.0 0 (0 :: GLdouble)
  drawFace filled cubeSize

  mapM_ (const $ r q 1 0 0 >> drawFace filled cubeSize) [1 .. 3 :: Integer]

  r q 1 0 0
  r q 0 1 0
  drawFace filled cubeSize

  r f 0 1 0
  drawFace filled cubeSize

  where
    f, q :: GLfloat
    f = 180.0
    q = 90.0

    r :: GLfloat -> GLfloat -> GLfloat -> GLfloat -> IO ()
    r r' x y z = rotate r' $ Vector3 x y z