This repository has been archived on 2025-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
htanks/src/Texture.hs

19 lines
626 B
Haskell

module Texture ( Texture(..)
, TextureObject
, texturePath
) where
import Paths_htanks
import Graphics.Rendering.OpenGL.GL.Texturing.Objects (TextureObject)
data Texture = TextureWood | TextureTank | TextureCannon | TextureBullet | TextureCrosshair
deriving (Eq, Ord, Show)
texturePath :: Texture -> IO FilePath
texturePath t = getDataFileName $ "tex/" ++ (name t) ++ ".png"
where
name TextureWood = "Wood"
name TextureTank = "Tank"
name TextureCannon = "Cannon"
name TextureBullet = "Bullet"
name TextureCrosshair = "Crosshair"