never executed always true always false
    1 {-|
    2 Module: Flaw.Graphics.Sampler
    3 Description: Abstract sampler things.
    4 License: MIT
    5 -}
    6 
    7 module Flaw.Graphics.Sampler
    8   ( SamplerWrap(..)
    9   , SamplerFilter(..)
   10   , SamplerStateInfo(..)
   11   ) where
   12 
   13 import Data.Default
   14 
   15 import Flaw.Math
   16 
   17 -- | Wrapping mode.
   18 data SamplerWrap
   19   = SamplerWrapRepeat
   20   | SamplerWrapRepeatMirror
   21   | SamplerWrapClamp
   22   | SamplerWrapBorder
   23   deriving Show
   24 
   25 -- | Filtering mode.
   26 data SamplerFilter
   27   = SamplerPointFilter
   28   | SamplerLinearFilter
   29   deriving Show
   30 
   31 -- | Sampler settings.
   32 data SamplerStateInfo = SamplerStateInfo
   33   { samplerMinFilter :: !SamplerFilter
   34   , samplerMipFilter :: !SamplerFilter
   35   , samplerMagFilter :: !SamplerFilter
   36   , samplerWrapU :: !SamplerWrap
   37   , samplerWrapV :: !SamplerWrap
   38   , samplerWrapW :: !SamplerWrap
   39   , samplerMinLod :: {-# UNPACK #-} !Float
   40   , samplerMaxLod :: {-# UNPACK #-} !Float
   41   , samplerBorderColor :: {-# UNPACK #-} !Float4
   42   , samplerMaxAnisotropy :: {-# UNPACK #-} !Int
   43   } deriving Show
   44 
   45 instance Default SamplerStateInfo where
   46   def = SamplerStateInfo
   47     { samplerMinFilter = SamplerPointFilter
   48     , samplerMipFilter = SamplerPointFilter
   49     , samplerMagFilter = SamplerPointFilter
   50     , samplerWrapU = SamplerWrapRepeat
   51     , samplerWrapV = SamplerWrapRepeat
   52     , samplerWrapW = SamplerWrapRepeat
   53     , samplerMinLod = -1000
   54     , samplerMaxLod = 1000
   55     , samplerBorderColor = Vec4 0 0 0 0
   56     , samplerMaxAnisotropy = 1
   57     }