-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell-embedded OpenGL -- -- A simple, functional approach to OpenGL programming in Haskell. -- -- All definitions that comprise HaGL are provided by the top-level -- Graphics.HaGL module. @package HaGL @version 0.1.0.0 module Graphics.HaGL.Internal constEval :: GLExpr ConstDomain t -> t hostEval :: IOEvaluator -> GLExpr HostDomain t -> IO t printGLExpr :: IsGLDomain d => GLExpr d t -> String dumpGlsl :: GLObj -> String genericUniform :: GLType t => String -> GLExpr d t type IOEvaluator = forall t. GLExpr HostDomain t -> IO t data GLExprException UnsupportedRecCall :: GLExprException UnsupportedNameCapture :: GLExprException UnknownArraySize :: GLExprException data GLObjException NoInputVars :: GLObjException EmptyInputVar :: GLObjException MismatchedInputVars :: GLObjException data EvalException GenericUniformEval :: EvalException -- | This module exports everything that comprises the core language. -- -- It is best used with the following extensions enabled: GADTs, -- DataKinds, ViewPatterns, FlexibleContexts. -- -- Note that quite a few of the exported functions clash with unrelated -- ones from Prelude (max, length, mod, any, -- etc.) or class methods with identical behaviour (abs, -- sin, etc.), in an effort to prioritize consistency with GLSL -- function naming. -- -- In summary, this module can be imported as follows: -- --
--   {-# LANGUAGE GADTs #-}
--   {-# LANGUAGE DataKinds #-}
--   {-# LANGUAGE ViewPatterns #-}
--   {-# LANGUAGE FlexibleContexts #-}
--   
--   import Prelude hiding (max, sin, cos, ...)
--   
--   import Graphics.HaGL
--   
-- -- HaGL expressions have the type GLExpr (d :: GLDomain) t, -- where d is the domain of computation and t is the -- underlying numeric type, which is always an instance of GLType. -- Here are some example expressions: -- --
--   -- A vertex attribute constructed from its input values on three vertices
--   x :: GLExpr VertexDomain Float
--   x = vert [-1, 0, 1]
--   
--   -- Numeric operators and functions like (+) and sin can handle generic
--   -- expressions. Note that in this example the domain of the inputs to
--   -- these functions is VertexDomain, so we know that these functions will 
--   -- be computed in a vertex shader.
--   y :: GLExpr VertexDomain Float
--   y = sin (2 * x + 1)
--   
--   -- 'frag x' is a a fragment variable corresponding to an interpolation of
--   -- the value of x at the vertices that define its containing primitive.
--   -- Because it has the type 'GLExpr FragmentDomain Float', the addition
--   -- below will be computed in a fragment shader.
--   z :: GLExpr FragmentDomain Float
--   z = frag x + 3
--   
--   -- 'time' is a built-in I/O variable and as such it is computed on the CPU
--   time :: GLExpr HostDomain Float
--   
--   -- We can use 'uniform' to lift a host variable to an arbitrary domain
--   -- Here 'uniform time' is inferred to have type 'GLExpr VertexDomain Float':
--   yPlusTime :: GLExpr VertexDomain Float
--   yPlusTime = y + uniform time
--   
--   -- Here 'uniform time' is inferred to be of type 'GLExpr FragmentDomain Float':
--   zPlusTime :: GLExpr FragmentDomain Float
--   zPlusTime = z + uniform time
--   
--   -- A generic floating-point vector of length 4
--   v :: GLExpr d (Vec 4 Float)
--   v = vec4 1 1 1 1
--   
--   -- A vector can be initialized from a numeric literal, so long as its
--   -- underlying type 'Vec n t' is specified or can be inferred.
--   -- Here is another way to define the same vector v:
--   v' :: GLExpr d (Vec 4 Float)
--   v' = 1
--   
--   -- Matrices are constructed from their columns:
--   m :: GLExpr d (Mat 2 3 Float)
--   m = mat2x3 (vec2 1 2) (vec2 3 4) (vec2 5 6)
--   
--   -- Operators like (.+) and (.*) act component-wise on vectors and matrices:
--   _ = m .+ m .== mat2x3 (vec2 2 4) (vec2 6 8) (vec2 10 12)
--   
--   -- Non-boolean primitives and vectors over such types are instances of Num;
--   -- in such cases Num methods like (+) can be used instead.
--   _ = vec2 1 1 + 1 .== vec2 2 2
--   
--   -- The operator (.#) performs scalar multiplication:
--   _ = 3 .# v
--   _ = 3 .# m
--   
--   -- The operator (.@) performs matrix multiplication
--   -- (including matrix-vector multiplication):
--   m1 :: GLExpr d (Mat 2 3 Float)
--   m1 = ...
--   m2 :: GLExpr d (Mat 3 4 Float)
--   m2 = ...
--   m1m2 :: GLExpr d (Mat 2 4 Float)
--   m1m2 = m1 .@ m2
--   
--   -- All multiplications here will take place in a vertex shader:
--   m1m2v :: GLExpr VertexDomain (Vec 2 Float)
--   m1m2v = m1m2 .@ v
--   
--   -- The inferred type of m1m2 in this expression is 
--   -- 'GLExpr HostDomain (Mat 2 4 Float)' so the multiplication of m1 and m2 
--   -- will take place on the CPU.
--   -- The inferred type of uniform m1m2 is 'GLExpr VertexDomain (Mat 2 4 Float)'
--   -- and that of v is 'GLExpr VertexDomain (Vec 2 Float)' so their
--   -- multiplication will take place in a vertex shader.
--   m1m2v' :: GLExpr VertexDomain (Vec 2 Float)
--   m1m2v' = uniform m1m2 .@ v
--   
-- -- GLExprs can be used to construct GLObjs, which being -- instances of Drawable can be interpreted by a given -- Backend using draw. For example: -- --
--   -- initialize pos from the vertices of some 3D object
--   pos :: GLExpr VertexDomain (Vec 4 Float)
--   pos = vert [vec4 1 0 0 1, ...]
--   
--   red :: GLExpr FragmentDomain (Vec 4 Float)
--   red = vec4 1 0 0 1
--   
--   redObj :: GLObj
--   redObj = GLObj {
--       primitiveMode = TriangleStrip,
--       indices = Nothing,
--       position = pos,
--       color = red,
--       discardWhen = False
--   }
--   
--   -- or equivalently,
--   redObj' :: GLObj
--   redObj' = triangleStrip { position = pos, color = red }
--   
--   -- we can now draw the object
--   main :: IO ()
--   main = draw GlutBackend redObj
--   
-- -- A complete set of examples explained in more depth can be found in the -- "Getting Started" guide. module Graphics.HaGL -- | The class of base raw types. Users should not and need not implement -- any instances of this class. class (Eq t, Show t) => GLType t -- | Single-precision floating point numbers. It is desirable that this -- type be at least equal in range and precision to the IEEE -- single-precision type. data Float -- | Double-precision floating point numbers. It is desirable that this -- type be at least equal in range and precision to the IEEE -- double-precision type. data Double -- | A fixed-precision integer type with at least the range [-2^29 .. -- 2^29-1]. The exact range for a given implementation can be -- determined by using minBound and maxBound from the -- Bounded class. data Int -- | An unsigned integer type UInt = Word32 data Bool -- | A matrix with p rows, q columns, and element type -- t data Mat (p :: Nat) (q :: Nat) (t :: *) -- | A column vector with n elements and element type t type Vec n t = Mat n 1 t -- | The type of the elements of t or t itself if -- t is primitive type family GLElt t -- | Construct a matrix from a mapping that maps indices (i, j) to -- the element at row i and column j fromMapping :: forall p q t. (KnownNat p, KnownNat q) => ((Int, Int) -> t) -> Mat p q t -- | Construct a matrix from a list of the matrix elements in row-major -- order fromList :: forall p q t. (KnownNat p, KnownNat q) => [t] -> Mat p q t -- | Any primitive type class (GLType t, Storable t, Enum t, Eq t, Ord t) => GLPrim t -- | Any single-precision primitive type class (GLPrim t, Storable t, Enum t, Eq t, Ord t) => GLSingle t -- | Any numeric primitive type class (GLPrim t, Num t) => GLNumeric t -- | Any signed primitive type class GLNumeric t => GLSigned t -- | Any single- or double-precision floating-point type class (GLSigned t, RealFrac t, Floating t) => GLFloating t -- | Any single-precision signed primitive type class GLSigned t => GLSingleNumeric t -- | Any signed or unsigned integer type class (GLPrim t, Integral t, Bits t) => GLInteger t -- | A primitive type or a vector type class GLType t => GLPrimOrVec t -- | The underlying type of a vertex input variable. Double-precision types -- are currently not permitted due to an issue in the OpenGL bindings. class (GLPrimOrVec t, Storable (StoreElt t)) => GLInputType t -- | Any type whose values can be interpolated smoothly when constructing a -- fragment variable class GLInputType t => GLSupportsSmoothInterp t -- | Any type which supports bitwise operations class (GLType t, Integral (GLElt t), Bits (GLElt t)) => GLSupportsBitwiseOps t -- | A generic HaGL expression with domain of computation d and -- underlying type t data GLExpr (d :: GLDomain) (t :: *) -- | A label for the domain where a given computation make take place data GLDomain -- | Labels a constant value computed on the host CPU ConstDomain :: GLDomain -- | Labels a potentially I/O-dependent value computed on the host CPU HostDomain :: GLDomain -- | Labels a vertex shader variable VertexDomain :: GLDomain -- | Labels a fragment shader variable FragmentDomain :: GLDomain type ConstExpr = GLExpr ConstDomain type HostExpr = GLExpr HostDomain type VertExpr = GLExpr VertexDomain type FragExpr = GLExpr FragmentDomain -- | Construct a GLExpr from a raw type. Rarely useful as this can -- be done implicitly; e.g., from a numeric literal. cnst :: GLType t => ConstExpr t -> GLExpr d t -- | The boolean value true true :: GLExpr d Bool -- | The boolean value false false :: GLExpr d Bool -- | Lift a HostExpr to an arbitrary GLExpr whose value is -- the same across any primitive processed in a shader, if used in the -- context of one uniform :: GLType t => HostExpr t -> GLExpr d t -- | prec x0 x is used to obtain a reference to the value -- x one "time-step" in the past, or x0 at the zero-th -- point in time. The prec operator is usually used to define -- expressions recurrently; for example: let x = prec 0 (x + 1) -- counts the total number of points in time. The interpretation of a -- time-step in a given backend is normally an interval that is on -- average equal to the length of time between two redraws. prec :: GLType t => HostExpr t -> HostExpr t -> HostExpr t -- | A vertex input variable (attribute) constructed from a stream of -- per-vertex data. The number of vertices (the length of the stream) -- should be consistent across all vertex attributes used to construct a -- given GLObj. vert :: GLInputType t => [ConstExpr t] -> VertExpr t -- | A fragment input variable constructed from the output data of a vertex -- variable, interpolated in a perspective-correct manner over the -- primitive being processed frag :: GLSupportsSmoothInterp t => VertExpr t -> FragExpr t -- | A fragment input variable constructed from the output data of a vertex -- variable, interpolated linearly across the primitive being processed noperspFrag :: GLSupportsSmoothInterp t => GLInputType t => VertExpr t -> FragExpr t -- | A fragment input variable constructed from the output data of a vertex -- variable, having the same value across the primitive being processed -- (cf. the OpenGL API for which vertex is used to determine its value) flatFrag :: GLInputType t => VertExpr t -> FragExpr t vec2 :: forall {t1} {d :: GLDomain}. GLType (Mat 2 1 t1) => GLExpr d t1 -> GLExpr d t1 -> GLExpr d (Mat 2 1 t1) vec3 :: forall {t1} {d :: GLDomain}. GLType (Mat 3 1 t1) => GLExpr d t1 -> GLExpr d t1 -> GLExpr d t1 -> GLExpr d (Mat 3 1 t1) vec4 :: forall {t1} {d :: GLDomain}. GLType (Mat 4 1 t1) => GLExpr d t1 -> GLExpr d t1 -> GLExpr d t1 -> GLExpr d t1 -> GLExpr d (Mat 4 1 t1) mat2 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 2 t1), GLType (Mat 2 2 t1)) => GLExpr d (Vec 2 t1) -> GLExpr d (Vec 2 t1) -> GLExpr d (Mat 2 2 t1) mat3 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 3 t1), GLType (Mat 3 3 t1)) => GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Mat 3 3 t1) mat4 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 4 t1), GLType (Mat 4 4 t1)) => GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Mat 4 4 t1) mat2x2 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 2 t1), GLType (Mat 2 2 t1)) => GLExpr d (Vec 2 t1) -> GLExpr d (Vec 2 t1) -> GLExpr d (Mat 2 2 t1) mat2x3 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 2 t1), GLType (Mat 2 3 t1)) => GLExpr d (Vec 2 t1) -> GLExpr d (Vec 2 t1) -> GLExpr d (Vec 2 t1) -> GLExpr d (Mat 2 3 t1) mat2x4 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 2 t1), GLType (Mat 2 4 t1)) => GLExpr d (Vec 2 t1) -> GLExpr d (Vec 2 t1) -> GLExpr d (Vec 2 t1) -> GLExpr d (Vec 2 t1) -> GLExpr d (Mat 2 4 t1) mat3x2 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 3 t1), GLType (Mat 3 2 t1)) => GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Mat 3 2 t1) mat3x3 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 3 t1), GLType (Mat 3 3 t1)) => GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Mat 3 3 t1) mat3x4 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 3 t1), GLType (Mat 3 4 t1)) => GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Mat 3 4 t1) mat4x2 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 4 t1), GLType (Mat 4 2 t1)) => GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Mat 4 2 t1) mat4x3 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 4 t1), GLType (Mat 4 3 t1)) => GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Mat 4 3 t1) mat4x4 :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Vec 4 t1), GLType (Mat 4 4 t1)) => GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Vec 4 t1) -> GLExpr d (Mat 4 4 t1) -- | Extend a vector by prepending an element pre :: forall {n :: Nat} {t1} {d :: GLDomain}. (GLType (Vec n t1), GLType (Mat (n + 1) 1 t1)) => GLExpr d t1 -> GLExpr d (Vec n t1) -> GLExpr d (Mat (n + 1) 1 t1) -- | Extend a vector by appending an element app :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLType t1, GLType (Vec n t1), GLType (Mat (n + 1) 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d t1 -> GLExpr d (Mat (n + 1) 1 t1) -- | Concatenate two vectors together ($-) :: forall {m :: Nat} {t1} {n :: Nat} {d :: GLDomain}. (GLType (Vec m t1), GLType (Vec n t1), GLType (Mat (m + n) 1 t1)) => GLExpr d (Vec m t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat (m + n) 1 t1) infixr 8 $- -- | Create an array from a list of HostExprs array :: GLType [t1] => [GLExpr 'HostDomain t1] -> GLExpr 'HostDomain [t1] -- | An expression that can be deconstructed into its components class Deconstructible t where { -- | The resulting type of the deconstruction type Decon t; } -- | Deconstruct the given expression decon :: Deconstructible t => t -> Decon t x_ :: forall {n :: Nat} {t} {d :: GLDomain}. (OrdCond (CmpNat 1 n) 'True 'True 'False ~ 'True, GLType t, GLType (Vec n t)) => GLExpr d (Vec n t) -> GLExpr d t y_ :: forall {n :: Nat} {t} {d :: GLDomain}. (OrdCond (CmpNat 2 n) 'True 'True 'False ~ 'True, GLType t, GLType (Vec n t)) => GLExpr d (Vec n t) -> GLExpr d t z_ :: forall {n :: Nat} {t} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType t, GLType (Vec n t)) => GLExpr d (Vec n t) -> GLExpr d t w_ :: forall {n :: Nat} {t} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType t, GLType (Vec n t)) => GLExpr d (Vec n t) -> GLExpr d t xy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 2 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) xz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) xw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) yx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 2 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) yz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) yw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) zx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) zy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) zw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) wx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) wy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) wz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 2 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 2 1 t1) xyz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) xyw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) xzy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) xzw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) xwy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) xwz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) yxz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) yxw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) yzx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) yzw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) ywx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) ywz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) zxy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) zxw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) zyx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) zyw_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) zwx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) zwy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) wxy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) wxz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) wyx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) wyz_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) wzx_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) wzy_ :: forall {n :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 n) 'True 'True 'False ~ 'True, GLType (Vec n t1), GLType (Mat 3 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat 3 1 t1) -- | The first column of a matrix col0 :: forall {c :: Nat} {r :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 1 c) 'True 'True 'False ~ 'True, GLType (Mat r c t1), GLType (Mat r 1 t1)) => GLExpr d (Mat r c t1) -> GLExpr d (Mat r 1 t1) -- | The second column of a matrix col1 :: forall {c :: Nat} {r :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 2 c) 'True 'True 'False ~ 'True, GLType (Mat r c t1), GLType (Mat r 1 t1)) => GLExpr d (Mat r c t1) -> GLExpr d (Mat r 1 t1) -- | The third column of a matrix col2 :: forall {c :: Nat} {r :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 3 c) 'True 'True 'False ~ 'True, GLType (Mat r c t1), GLType (Mat r 1 t1)) => GLExpr d (Mat r c t1) -> GLExpr d (Mat r 1 t1) -- | The fourth column of a matrix col3 :: forall {c :: Nat} {r :: Nat} {t1} {d :: GLDomain}. (OrdCond (CmpNat 4 c) 'True 'True 'False ~ 'True, GLType (Mat r c t1), GLType (Mat r 1 t1)) => GLExpr d (Mat r c t1) -> GLExpr d (Mat r 1 t1) -- | Array index operator, returning the i-th (0-indexed) element -- of the array (.!) :: forall {t} {d :: GLDomain}. (GLType t, GLType [t]) => GLExpr d [t] -> GLExpr d Int -> GLExpr d t -- | Coerce the primitive type of a value to arbitrary primitive type cast :: forall {t1} {t} {d :: GLDomain}. (GLPrim t1, GLPrim t) => GLExpr d t1 -> GLExpr d t -- | Coerce the element type of a matrix to an arbitrary primitive type matCast :: forall {t1} {t2} {p :: Nat} {q :: Nat} {d :: GLDomain}. (GLPrim t1, GLPrim t2, KnownNat p, KnownNat q, GLType (Mat p q t2)) => GLExpr d (Mat p q t1) -> GLExpr d (Mat p q t2) (.+) :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLType t) => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 6 .+ (.-) :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLType t) => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 6 .- (.*) :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLType t) => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 7 .* (./) :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLType t) => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 7 ./ (.%) :: forall {t} {d :: GLDomain}. (GLInteger (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 7 .% -- | Scalar multiplication (.#) :: forall {t1} {p :: Nat} {q :: Nat} {d :: GLDomain}. (GLNumeric t1, GLType (Mat p q t1)) => GLExpr d t1 -> GLExpr d (Mat p q t1) -> GLExpr d (Mat p q t1) infixl 7 .# -- | Matrix multiplication (.@) :: forall {t1} {p :: Nat} {r :: Nat} {q :: Nat} {d :: GLDomain}. (GLFloating t1, GLType (Mat p r t1), GLType (Mat p q t1), GLType (Mat q r t1)) => GLExpr d (Mat p q t1) -> GLExpr d (Mat q r t1) -> GLExpr d (Mat p r t1) infixl 7 .@ -- | Arithmetic negation neg :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLType t) => GLExpr d t -> GLExpr d t (.<) :: forall {t1} {d :: GLDomain}. GLNumeric t1 => GLExpr d t1 -> GLExpr d t1 -> GLExpr d Bool infix 4 .< (.<=) :: forall {t1} {d :: GLDomain}. GLNumeric t1 => GLExpr d t1 -> GLExpr d t1 -> GLExpr d Bool infix 4 .<= (.>) :: forall {t1} {d :: GLDomain}. GLNumeric t1 => GLExpr d t1 -> GLExpr d t1 -> GLExpr d Bool infix 4 .> (.>=) :: forall {t1} {d :: GLDomain}. GLNumeric t1 => GLExpr d t1 -> GLExpr d t1 -> GLExpr d Bool infix 4 .>= (.==) :: forall {t1} {d :: GLDomain}. GLType t1 => GLExpr d t1 -> GLExpr d t1 -> GLExpr d Bool infix 4 .== (./=) :: forall {t1} {d :: GLDomain}. GLType t1 => GLExpr d t1 -> GLExpr d t1 -> GLExpr d Bool infix 4 ./= (.&&) :: forall {d :: GLDomain}. GLExpr d Bool -> GLExpr d Bool -> GLExpr d Bool infixl 3 .&& (.||) :: forall {d :: GLDomain}. GLExpr d Bool -> GLExpr d Bool -> GLExpr d Bool infixl 1 .|| (.^^) :: forall {d :: GLDomain}. GLExpr d Bool -> GLExpr d Bool -> GLExpr d Bool infixl 2 .^^ -- | Logical not nt :: forall {d :: GLDomain}. GLExpr d Bool -> GLExpr d Bool -- | Conditional operator, evaluating and returning its second or third -- argument if the first evaluates to true or false, respectively cond :: forall {t} {d :: GLDomain}. GLType t => GLExpr d Bool -> GLExpr d t -> GLExpr d t -> GLExpr d t (.<<) :: forall {t} {d :: GLDomain}. GLSupportsBitwiseOps t => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 5 .<< (.>>) :: forall {t} {d :: GLDomain}. GLSupportsBitwiseOps t => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 5 .>> (.&) :: forall {t} {d :: GLDomain}. GLSupportsBitwiseOps t => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 3 .& (.|) :: forall {t} {d :: GLDomain}. GLSupportsBitwiseOps t => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 1 .| (.^) :: forall {t} {d :: GLDomain}. GLSupportsBitwiseOps t => GLExpr d t -> GLExpr d t -> GLExpr d t infixl 2 .^ -- | One's complement compl :: forall {t} {d :: GLDomain}. GLSupportsBitwiseOps t => GLExpr d t -> GLExpr d t radians :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t degrees :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t sin :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t cos :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t tan :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t asin :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t acos :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t atan :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t sinh :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t cosh :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t tanh :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t asinh :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t acosh :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t atanh :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t pow :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t exp :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t log :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t exp2 :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t log2 :: forall {t} {d :: GLDomain}. (GLElt t ~ Float, GLPrimOrVec t) => GLExpr d t -> GLExpr d t sqrt :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t inversesqrt :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t abs :: forall {t} {d :: GLDomain}. (GLSigned (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t sign :: forall {t} {d :: GLDomain}. (GLSigned (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t floor :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t trunc :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t round :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t roundEven :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t ceil :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t fract :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t mod :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t min :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t max :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t clamp :: forall {t} {d :: GLDomain}. (GLNumeric (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t -> GLExpr d t mix :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t -> GLExpr d t step :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t smoothstep :: forall {t} {d :: GLDomain}. (GLFloating (GLElt t), GLPrimOrVec t) => GLExpr d t -> GLExpr d t -> GLExpr d t -> GLExpr d t length :: forall {t} {d :: GLDomain} {n :: Nat}. GLFloating t => GLExpr d (Vec n t) -> GLExpr d t distance :: forall {t} {d :: GLDomain} {n :: Nat}. GLFloating t => GLExpr d (Vec n t) -> GLExpr d (Vec n t) -> GLExpr d t dot :: forall {t} {n :: Nat} {d :: GLDomain}. (GLFloating t, GLType (Vec n t)) => GLExpr d (Vec n t) -> GLExpr d (Vec n t) -> GLExpr d t cross :: forall {t1} {d :: GLDomain}. (GLFloating t1, GLType (Mat 3 1 t1)) => GLExpr d (Vec 3 t1) -> GLExpr d (Vec 3 t1) -> GLExpr d (Mat 3 1 t1) normalize :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLFloating t1, GLType (Mat n 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 t1) faceforward :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLFloating t1, KnownNat n, GLType (Mat n 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 t1) reflect :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLFloating t1, KnownNat n, GLType (Mat n 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 t1) refract :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLFloating t1, KnownNat n, GLType (Mat n 1 t1)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d t1 -> GLExpr d (Mat n 1 t1) matrixCompMult :: forall {t1} {p :: Nat} {q :: Nat} {d :: GLDomain}. (GLFloating t1, GLType (Mat p q t1)) => GLExpr d (Mat p q t1) -> GLExpr d (Mat p q t1) -> GLExpr d (Mat p q t1) outerProduct :: forall {t1} {p :: Nat} {q :: Nat} {d :: GLDomain}. (GLFloating t1, GLType (Mat p q t1), GLType (Vec q t1)) => GLExpr d (Vec p t1) -> GLExpr d (Vec q t1) -> GLExpr d (Mat p q t1) transpose :: forall {t1} {q :: Nat} {p :: Nat} {d :: GLDomain}. (GLFloating t1, GLType (Mat q p t1), GLType (Mat p q t1)) => GLExpr d (Mat p q t1) -> GLExpr d (Mat q p t1) determinant :: forall {p :: Nat} {d :: GLDomain}. GLType (Mat p p Float) => GLExpr d (Mat p p Float) -> GLExpr d Float inverse :: forall {p :: Nat} {d :: GLDomain}. GLType (Mat p p Float) => GLExpr d (Mat p p Float) -> GLExpr d (Mat p p Float) lessThan :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLSingleNumeric t1, KnownNat n, GLType (Mat n 1 Bool)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 Bool) lessThanEqual :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLSingleNumeric t1, KnownNat n, GLType (Mat n 1 Bool)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 Bool) greaterThan :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLSingleNumeric t1, KnownNat n, GLType (Mat n 1 Bool)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 Bool) greaterThanEqual :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLSingleNumeric t1, KnownNat n, GLType (Mat n 1 Bool)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 Bool) equal :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLSingle t1, KnownNat n, GLType (Mat n 1 Bool)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 Bool) notEqual :: forall {t1} {n :: Nat} {d :: GLDomain}. (GLSingle t1, KnownNat n, GLType (Mat n 1 Bool)) => GLExpr d (Vec n t1) -> GLExpr d (Vec n t1) -> GLExpr d (Mat n 1 Bool) any :: forall {n :: Nat} {d :: GLDomain}. GLType (Vec n Bool) => GLExpr d (Vec n Bool) -> GLExpr d Bool all :: forall {n :: Nat} {d :: GLDomain}. GLType (Vec n Bool) => GLExpr d (Vec n Bool) -> GLExpr d Bool not :: forall {n :: Nat} {d :: GLDomain}. GLType (Mat n 1 Bool) => GLExpr d (Vec n Bool) -> GLExpr d (Mat n 1 Bool) glFunc1 :: (GLType t, GLType t1) => (GLExpr d t1 -> GLExpr d t) -> GLExpr d t1 -> GLExpr d t glFunc2 :: (GLType t, GLType t1, GLType t2) => (GLExpr d t1 -> GLExpr d t2 -> GLExpr d t) -> GLExpr d t1 -> GLExpr d t2 -> GLExpr d t glFunc3 :: (GLType t, GLType t1, GLType t2, GLType t3) => (GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t) -> GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t glFunc4 :: (GLType t, GLType t1, GLType t2, GLType t3, GLType t4) => (GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t4 -> GLExpr d t) -> GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t4 -> GLExpr d t glFunc5 :: (GLType t, GLType t1, GLType t2, GLType t3, GLType t4, GLType t5) => (GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t4 -> GLExpr d t5 -> GLExpr d t) -> GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t4 -> GLExpr d t5 -> GLExpr d t glFunc6 :: (GLType t, GLType t1, GLType t2, GLType t3, GLType t4, GLType t5, GLType t6) => (GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t4 -> GLExpr d t5 -> GLExpr d t6 -> GLExpr d t) -> GLExpr d t1 -> GLExpr d t2 -> GLExpr d t3 -> GLExpr d t4 -> GLExpr d t5 -> GLExpr d t6 -> GLExpr d t glLift0 :: GLType t => t -> GLExpr 'HostDomain t glLift1 :: (GLType t, GLType t1) => (t1 -> t) -> GLExpr 'HostDomain t1 -> GLExpr 'HostDomain t glLift2 :: (GLType t, GLType t1, GLType t2) => (t1 -> t2 -> t) -> GLExpr 'HostDomain t1 -> GLExpr 'HostDomain t2 -> GLExpr 'HostDomain t glLift3 :: (GLType t, GLType t1, GLType t2, GLType t3) => (t1 -> t2 -> t3 -> t) -> GLExpr 'HostDomain t1 -> GLExpr 'HostDomain t2 -> GLExpr 'HostDomain t3 -> GLExpr 'HostDomain t glLift4 :: (GLType t, GLType t1, GLType t2, GLType t3, GLType t4) => (t1 -> t2 -> t3 -> t4 -> t) -> GLExpr 'HostDomain t1 -> GLExpr 'HostDomain t2 -> GLExpr 'HostDomain t3 -> GLExpr 'HostDomain t4 -> GLExpr 'HostDomain t glLift5 :: (GLType t, GLType t1, GLType t2, GLType t3, GLType t4, GLType t5) => (t1 -> t2 -> t3 -> t4 -> t5 -> t) -> GLExpr 'HostDomain t1 -> GLExpr 'HostDomain t2 -> GLExpr 'HostDomain t3 -> GLExpr 'HostDomain t4 -> GLExpr 'HostDomain t5 -> GLExpr 'HostDomain t glLift6 :: (GLType t, GLType t1, GLType t2, GLType t3, GLType t4, GLType t5, GLType t6) => (t1 -> t2 -> t3 -> t4 -> t5 -> t6 -> t) -> GLExpr 'HostDomain t1 -> GLExpr 'HostDomain t2 -> GLExpr 'HostDomain t3 -> GLExpr 'HostDomain t4 -> GLExpr 'HostDomain t5 -> GLExpr 'HostDomain t6 -> GLExpr 'HostDomain t -- | Seconds elapsed since an initial point in time time :: HostExpr Float -- | True if and only if the left mouse button is pressed mouseLeft :: HostExpr Bool -- | True if and only if the right mouse button is pressed mouseRight :: HostExpr Bool -- | A pulse signal, equal to 1 at the moment the mouse wheel scrolls up, -- -1 when the mouse wheel scrolls down, and afterwards exponentially -- decaying to its otherwise default value of 0 mouseWheel :: HostExpr Float -- | The horizontal position of the mouse, not necessarily within the -- window bounds mouseX :: HostExpr Float -- | The vertical position of the mouse, not necessarily within the window -- bounds mouseY :: HostExpr Float -- | Equal to vec2 mouseX mouseY mousePos :: HostExpr (Vec 2 Float) -- | Anything that can be drawn using a given Backend class Drawable a draw :: Drawable a => Backend -> a -> IO () -- | A drawable object specified by a set of variables of type -- GLExpr and the PrimitiveMode according to which output -- vertices of the variable position, indexed by indices, -- should be interpreted. -- -- When using the convenience functions points, triangles, -- etc., to define a GLObj with the corresponding -- PrimitiveMode, at the very minimum the fields position -- and color must be set before drawing the GLObj. data GLObj GLObj :: PrimitiveMode -> Maybe [ConstExpr UInt] -> VertExpr (Vec 4 Float) -> FragExpr (Vec 4 Float) -> FragExpr Bool -> GLObj -- | The PrimitiveMode that will be used to draw the object [primitiveMode] :: GLObj -> PrimitiveMode -- | A set of position indices used to construct the primitives of the -- object [indices] :: GLObj -> Maybe [ConstExpr UInt] -- | A vertex variable specifying the position of an arbitrary vertex [position] :: GLObj -> VertExpr (Vec 4 Float) -- | A fragment variable specifying the color of an arbitrary fragment [color] :: GLObj -> FragExpr (Vec 4 Float) -- | An fragment variable specifying the condition for discarding an -- arbitrary fragment [discardWhen] :: GLObj -> FragExpr Bool -- | See Graphics.Rendering.OpenGL.GL.PrimitiveMode for a -- description of each PrimitiveMode type PrimitiveMode = PrimitiveMode -- | An incompletely specified object with PrimitiveMode equal to -- Points points :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- Lines lines :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- LineLoop lineLoop :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- LineStrip lineStrip :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- Triangles triangles :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- TriangleStrip triangleStrip :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- TriangleFan triangleFan :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- Quads quads :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- QuadStrip quadStrip :: GLObj -- | An incompletely specified object with PrimitiveMode equal to -- Polygon polygon :: GLObj -- | A backend that can interpret (draw) a Drawable. Unless -- overridden the following OpenGL options are set by default in all -- backends: -- -- data Backend GlutBackend :: GlutOptions -> Backend -- | Options specific to a GLUT window data GlutOptions GlutOptions :: Maybe (GLint, GLint) -> (GLsizei, GLsizei) -> Bool -> Maybe String -> (Float, Float, Float, Float) -> GlutRunMode -> IO () -> GlutOptions -- | The position of the window [winPosition] :: GlutOptions -> Maybe (GLint, GLint) -- | The size of the window [winSize] :: GlutOptions -> (GLsizei, GLsizei) -- | Whether to draw in fullscreen mode [winFullscreen] :: GlutOptions -> Bool -- | The title of the window [winTitle] :: GlutOptions -> Maybe String -- | The (background) color to use when clearing the screen [clearCol] :: GlutOptions -> (Float, Float, Float, Float) -- | The GlutRunMode under which to run the application [runMode] :: GlutOptions -> GlutRunMode -- | Any additional OpenGL-specific setup to run just after the window has -- been set up. The typical use-case is to import the OpenGL bindings -- (OpenGL) and define a StateVar such as -- lineWidth [openGLSetup] :: GlutOptions -> IO () -- | GlutRunMode specifies how to run the resulting application data GlutRunMode -- | Display the output in a window GlutNormal :: GlutRunMode -- | Display the output in a window, saving the latest frame in the -- specified file location GlutCaptureLatest :: String -> GlutRunMode -- | Display the output in a window, saving all frames in the specified -- directory GlutCaptureFrames :: String -> GlutRunMode -- | Display the output in a window for a brief period time, saving the -- latest frame in the specified file location GlutCaptureAndExit :: String -> GlutRunMode -- | Draw in a GLUT backend using default options drawGlut :: Drawable a => a -> IO () -- | Draw in a GLUT backend using specified options drawGlutCustom :: Drawable a => GlutOptions -> a -> IO () -- | Default options for a GLUT backend -- -- defaultGlutOptions :: GlutOptions instance Graphics.HaGL.Drawable Graphics.HaGL.GLObj.GLObj instance Graphics.HaGL.Drawable [Graphics.HaGL.GLObj.GLObj] instance (Graphics.HaGL.GLType.GLPrim t, Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec 2 t)) => Graphics.HaGL.Deconstructible (Graphics.HaGL.GLExpr.GLExpr d (Graphics.HaGL.Numerical.Vec 2 t)) instance (Graphics.HaGL.GLType.GLPrim t, Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec 3 t)) => Graphics.HaGL.Deconstructible (Graphics.HaGL.GLExpr.GLExpr d (Graphics.HaGL.Numerical.Vec 3 t)) instance (Graphics.HaGL.GLType.GLPrim t, Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec 4 t)) => Graphics.HaGL.Deconstructible (Graphics.HaGL.GLExpr.GLExpr d (Graphics.HaGL.Numerical.Vec 4 t)) instance (Graphics.HaGL.GLType.GLPrim t, Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Mat p 2 t), Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec p t)) => Graphics.HaGL.Deconstructible (Graphics.HaGL.GLExpr.GLExpr d (Graphics.HaGL.Numerical.Mat p 2 t)) instance (Graphics.HaGL.GLType.GLPrim t, Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Mat p 3 t), Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec p t)) => Graphics.HaGL.Deconstructible (Graphics.HaGL.GLExpr.GLExpr d (Graphics.HaGL.Numerical.Mat p 3 t)) instance (Graphics.HaGL.GLType.GLPrim t, Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Mat p 4 t), Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec p t)) => Graphics.HaGL.Deconstructible (Graphics.HaGL.GLExpr.GLExpr d (Graphics.HaGL.Numerical.Mat p 4 t)) instance Graphics.HaGL.GLType.GLPrim t => GHC.Enum.Enum (Graphics.HaGL.GLExpr.ConstExpr t) instance (Graphics.HaGL.GLType.GLSigned (Graphics.HaGL.GLType.GLElt t), Graphics.HaGL.GLType.GLPrimOrVec t, GHC.Num.Num t) => GHC.Num.Num (Graphics.HaGL.GLExpr.GLExpr d t) instance GHC.Num.Num (Graphics.HaGL.GLExpr.GLExpr d Graphics.HaGL.GLType.UInt) instance (Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec n Graphics.HaGL.GLType.UInt), Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec n GHC.Types.Int), Graphics.HaGL.GLType.GLType (Graphics.HaGL.Numerical.Vec n GHC.Types.Bool), GHC.TypeNats.KnownNat n) => GHC.Num.Num (Graphics.HaGL.GLExpr.GLExpr d (Graphics.HaGL.Numerical.Vec n Graphics.HaGL.GLType.UInt)) instance (Graphics.HaGL.GLType.GLFloating (Graphics.HaGL.GLType.GLElt t), Graphics.HaGL.GLType.GLPrimOrVec t, GHC.Real.Fractional t) => GHC.Real.Fractional (Graphics.HaGL.GLExpr.GLExpr d t) instance (Graphics.HaGL.GLType.GLElt t GHC.Types.~ GHC.Types.Float, Graphics.HaGL.GLType.GLPrimOrVec t, GHC.Real.Fractional t) => GHC.Float.Floating (Graphics.HaGL.GLExpr.GLExpr d t)