module Graphics.IxShader.Types.Xbool where
import Prelude hiding (Ord (..), Read, return, (>>),
(>>=), Eq (..))
import Graphics.IxShader.Socket
import Graphics.IxShader.Function.ToParams
import Graphics.IxShader.IxShader
newtype Xbool = Xbool { unXbool :: String }
$(genKnownTypeSymbol [t|Xbool|] [e|"bool"|])
$(genSocketed [t|Xbool|] [e|unXbool|] [e|Xbool|])
$(genToParams [t|Xbool|])
ifThenElse :: Xbool -> IxShader ctx i i () -> IxShader ctx i i () -> IxShader ctx i i ()
ifThenElse x a b = do
nxt_ $ "if (" ++ unSocket x ++ ")"
sub_ "{" "}" a
sub_ "else {" "}" b
when :: Xbool -> IxShader ctx i i () -> IxShader ctx i i ()
when x a = do
nxt_ $ "if (" ++ unSocket x ++ ")"
sub_ "{" "}" a
unless :: Xbool -> IxShader ctx i i () -> IxShader ctx i i ()
unless x a = do
nxt_ $ "if (! " ++ unSocket x ++ ")"
sub_ "{" "}" a