{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Graphene.Structs.Vec4
(
Vec4(..) ,
newZeroVec4 ,
#if defined(ENABLE_OVERLOADING)
ResolveVec4Method ,
#endif
#if defined(ENABLE_OVERLOADING)
Vec4AddMethodInfo ,
#endif
vec4Add ,
vec4Alloc ,
#if defined(ENABLE_OVERLOADING)
Vec4DivideMethodInfo ,
#endif
vec4Divide ,
#if defined(ENABLE_OVERLOADING)
Vec4DotMethodInfo ,
#endif
vec4Dot ,
#if defined(ENABLE_OVERLOADING)
Vec4EqualMethodInfo ,
#endif
vec4Equal ,
#if defined(ENABLE_OVERLOADING)
Vec4FreeMethodInfo ,
#endif
vec4Free ,
#if defined(ENABLE_OVERLOADING)
Vec4GetWMethodInfo ,
#endif
vec4GetW ,
#if defined(ENABLE_OVERLOADING)
Vec4GetXMethodInfo ,
#endif
vec4GetX ,
#if defined(ENABLE_OVERLOADING)
Vec4GetXyMethodInfo ,
#endif
vec4GetXy ,
#if defined(ENABLE_OVERLOADING)
Vec4GetXyzMethodInfo ,
#endif
vec4GetXyz ,
#if defined(ENABLE_OVERLOADING)
Vec4GetYMethodInfo ,
#endif
vec4GetY ,
#if defined(ENABLE_OVERLOADING)
Vec4GetZMethodInfo ,
#endif
vec4GetZ ,
#if defined(ENABLE_OVERLOADING)
Vec4InitMethodInfo ,
#endif
vec4Init ,
#if defined(ENABLE_OVERLOADING)
Vec4InitFromFloatMethodInfo ,
#endif
vec4InitFromFloat ,
#if defined(ENABLE_OVERLOADING)
Vec4InitFromVec2MethodInfo ,
#endif
vec4InitFromVec2 ,
#if defined(ENABLE_OVERLOADING)
Vec4InitFromVec3MethodInfo ,
#endif
vec4InitFromVec3 ,
#if defined(ENABLE_OVERLOADING)
Vec4InitFromVec4MethodInfo ,
#endif
vec4InitFromVec4 ,
#if defined(ENABLE_OVERLOADING)
Vec4InterpolateMethodInfo ,
#endif
vec4Interpolate ,
#if defined(ENABLE_OVERLOADING)
Vec4LengthMethodInfo ,
#endif
vec4Length ,
#if defined(ENABLE_OVERLOADING)
Vec4MaxMethodInfo ,
#endif
vec4Max ,
#if defined(ENABLE_OVERLOADING)
Vec4MinMethodInfo ,
#endif
vec4Min ,
#if defined(ENABLE_OVERLOADING)
Vec4MultiplyMethodInfo ,
#endif
vec4Multiply ,
#if defined(ENABLE_OVERLOADING)
Vec4NearMethodInfo ,
#endif
vec4Near ,
#if defined(ENABLE_OVERLOADING)
Vec4NegateMethodInfo ,
#endif
vec4Negate ,
#if defined(ENABLE_OVERLOADING)
Vec4NormalizeMethodInfo ,
#endif
vec4Normalize ,
vec4One ,
#if defined(ENABLE_OVERLOADING)
Vec4ScaleMethodInfo ,
#endif
vec4Scale ,
#if defined(ENABLE_OVERLOADING)
Vec4SubtractMethodInfo ,
#endif
vec4Subtract ,
vec4WAxis ,
vec4XAxis ,
vec4YAxis ,
vec4ZAxis ,
vec4Zero ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec2 as Graphene.Vec2
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
newtype Vec4 = Vec4 (SP.ManagedPtr Vec4)
deriving (Vec4 -> Vec4 -> Bool
(Vec4 -> Vec4 -> Bool) -> (Vec4 -> Vec4 -> Bool) -> Eq Vec4
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Vec4 -> Vec4 -> Bool
$c/= :: Vec4 -> Vec4 -> Bool
== :: Vec4 -> Vec4 -> Bool
$c== :: Vec4 -> Vec4 -> Bool
Eq)
instance SP.ManagedPtrNewtype Vec4 where
toManagedPtr :: Vec4 -> ManagedPtr Vec4
toManagedPtr (Vec4 ManagedPtr Vec4
p) = ManagedPtr Vec4
p
foreign import ccall "graphene_vec4_get_type" c_graphene_vec4_get_type ::
IO GType
type instance O.ParentTypes Vec4 = '[]
instance O.HasParentTypes Vec4
instance B.Types.TypedObject Vec4 where
glibType :: IO GType
glibType = IO GType
c_graphene_vec4_get_type
instance B.Types.GBoxed Vec4
instance B.GValue.IsGValue Vec4 where
toGValue :: Vec4 -> IO GValue
toGValue Vec4
o = do
GType
gtype <- IO GType
c_graphene_vec4_get_type
Vec4 -> (Ptr Vec4 -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Vec4
o (GType -> (GValue -> Ptr Vec4 -> IO ()) -> Ptr Vec4 -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Vec4 -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO Vec4
fromGValue GValue
gv = do
Ptr Vec4
ptr <- GValue -> IO (Ptr Vec4)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr Vec4)
(ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Vec4 -> Vec4
Vec4 Ptr Vec4
ptr
newZeroVec4 :: MonadIO m => m Vec4
newZeroVec4 :: m Vec4
newZeroVec4 = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
16 IO (Ptr Vec4) -> (Ptr Vec4 -> IO Vec4) -> IO Vec4
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4
instance tag ~ 'AttrSet => Constructible Vec4 tag where
new :: (ManagedPtr Vec4 -> Vec4) -> [AttrOp Vec4 tag] -> m Vec4
new ManagedPtr Vec4 -> Vec4
_ [AttrOp Vec4 tag]
attrs = do
Vec4
o <- m Vec4
forall (m :: * -> *). MonadIO m => m Vec4
newZeroVec4
Vec4 -> [AttrOp Vec4 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Vec4
o [AttrOp Vec4 tag]
[AttrOp Vec4 'AttrSet]
attrs
Vec4 -> m Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
o
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Vec4
type instance O.AttributeList Vec4 = Vec4AttributeList
type Vec4AttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "graphene_vec4_alloc" graphene_vec4_alloc ::
IO (Ptr Vec4)
vec4Alloc ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Vec4
vec4Alloc :: m Vec4
vec4Alloc = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
result <- IO (Ptr Vec4)
graphene_vec4_alloc
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4Alloc" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_vec4_add" graphene_vec4_add ::
Ptr Vec4 ->
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Add ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m (Vec4)
vec4Add :: Vec4 -> Vec4 -> m Vec4
vec4Add Vec4
a Vec4
b = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
a' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
a
Ptr Vec4
b' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
b
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_add Ptr Vec4
a' Ptr Vec4
b' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
a
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
b
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4AddMethodInfo
instance (signature ~ (Vec4 -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4AddMethodInfo Vec4 signature where
overloadedMethod = vec4Add
#endif
foreign import ccall "graphene_vec4_divide" graphene_vec4_divide ::
Ptr Vec4 ->
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Divide ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m (Vec4)
vec4Divide :: Vec4 -> Vec4 -> m Vec4
vec4Divide Vec4
a Vec4
b = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
a' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
a
Ptr Vec4
b' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
b
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_divide Ptr Vec4
a' Ptr Vec4
b' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
a
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
b
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4DivideMethodInfo
instance (signature ~ (Vec4 -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4DivideMethodInfo Vec4 signature where
overloadedMethod = vec4Divide
#endif
foreign import ccall "graphene_vec4_dot" graphene_vec4_dot ::
Ptr Vec4 ->
Ptr Vec4 ->
IO CFloat
vec4Dot ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m Float
vec4Dot :: Vec4 -> Vec4 -> m Float
vec4Dot Vec4
a Vec4
b = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
a' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
a
Ptr Vec4
b' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
b
CFloat
result <- Ptr Vec4 -> Ptr Vec4 -> IO CFloat
graphene_vec4_dot Ptr Vec4
a' Ptr Vec4
b'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
a
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
b
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Vec4DotMethodInfo
instance (signature ~ (Vec4 -> m Float), MonadIO m) => O.MethodInfo Vec4DotMethodInfo Vec4 signature where
overloadedMethod = vec4Dot
#endif
foreign import ccall "graphene_vec4_equal" graphene_vec4_equal ::
Ptr Vec4 ->
Ptr Vec4 ->
IO CInt
vec4Equal ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m Bool
vec4Equal :: Vec4 -> Vec4 -> m Bool
vec4Equal Vec4
v1 Vec4
v2 = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v1' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v1
Ptr Vec4
v2' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v2
CInt
result <- Ptr Vec4 -> Ptr Vec4 -> IO CInt
graphene_vec4_equal Ptr Vec4
v1' Ptr Vec4
v2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v1
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data Vec4EqualMethodInfo
instance (signature ~ (Vec4 -> m Bool), MonadIO m) => O.MethodInfo Vec4EqualMethodInfo Vec4 signature where
overloadedMethod = vec4Equal
#endif
foreign import ccall "graphene_vec4_free" graphene_vec4_free ::
Ptr Vec4 ->
IO ()
vec4Free ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m ()
vec4Free :: Vec4 -> m ()
vec4Free Vec4
v = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec4 -> IO ()
graphene_vec4_free Ptr Vec4
v'
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data Vec4FreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo Vec4FreeMethodInfo Vec4 signature where
overloadedMethod = vec4Free
#endif
foreign import ccall "graphene_vec4_get_w" graphene_vec4_get_w ::
Ptr Vec4 ->
IO CFloat
vec4GetW ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m Float
vec4GetW :: Vec4 -> m Float
vec4GetW Vec4
v = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
CFloat
result <- Ptr Vec4 -> IO CFloat
graphene_vec4_get_w Ptr Vec4
v'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Vec4GetWMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo Vec4GetWMethodInfo Vec4 signature where
overloadedMethod = vec4GetW
#endif
foreign import ccall "graphene_vec4_get_x" graphene_vec4_get_x ::
Ptr Vec4 ->
IO CFloat
vec4GetX ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m Float
vec4GetX :: Vec4 -> m Float
vec4GetX Vec4
v = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
CFloat
result <- Ptr Vec4 -> IO CFloat
graphene_vec4_get_x Ptr Vec4
v'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Vec4GetXMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo Vec4GetXMethodInfo Vec4 signature where
overloadedMethod = vec4GetX
#endif
foreign import ccall "graphene_vec4_get_xy" graphene_vec4_get_xy ::
Ptr Vec4 ->
Ptr Graphene.Vec2.Vec2 ->
IO ()
vec4GetXy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m (Graphene.Vec2.Vec2)
vec4GetXy :: Vec4 -> m Vec2
vec4GetXy Vec4
v = IO Vec2 -> m Vec2
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec2 -> m Vec2) -> IO Vec2 -> m Vec2
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec2
res <- Int -> IO (Ptr Vec2)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec2.Vec2)
Ptr Vec4 -> Ptr Vec2 -> IO ()
graphene_vec4_get_xy Ptr Vec4
v' Ptr Vec2
res
Vec2
res' <- ((ManagedPtr Vec2 -> Vec2) -> Ptr Vec2 -> IO Vec2
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec2 -> Vec2
Graphene.Vec2.Vec2) Ptr Vec2
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec2 -> IO Vec2
forall (m :: * -> *) a. Monad m => a -> m a
return Vec2
res'
#if defined(ENABLE_OVERLOADING)
data Vec4GetXyMethodInfo
instance (signature ~ (m (Graphene.Vec2.Vec2)), MonadIO m) => O.MethodInfo Vec4GetXyMethodInfo Vec4 signature where
overloadedMethod = vec4GetXy
#endif
foreign import ccall "graphene_vec4_get_xyz" graphene_vec4_get_xyz ::
Ptr Vec4 ->
Ptr Graphene.Vec3.Vec3 ->
IO ()
vec4GetXyz ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m (Graphene.Vec3.Vec3)
vec4GetXyz :: Vec4 -> m Vec3
vec4GetXyz Vec4
v = IO Vec3 -> m Vec3
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec3 -> m Vec3) -> IO Vec3 -> m Vec3
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec3
res <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
Ptr Vec4 -> Ptr Vec3 -> IO ()
graphene_vec4_get_xyz Ptr Vec4
v' Ptr Vec3
res
Vec3
res' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec3 -> IO Vec3
forall (m :: * -> *) a. Monad m => a -> m a
return Vec3
res'
#if defined(ENABLE_OVERLOADING)
data Vec4GetXyzMethodInfo
instance (signature ~ (m (Graphene.Vec3.Vec3)), MonadIO m) => O.MethodInfo Vec4GetXyzMethodInfo Vec4 signature where
overloadedMethod = vec4GetXyz
#endif
foreign import ccall "graphene_vec4_get_y" graphene_vec4_get_y ::
Ptr Vec4 ->
IO CFloat
vec4GetY ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m Float
vec4GetY :: Vec4 -> m Float
vec4GetY Vec4
v = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
CFloat
result <- Ptr Vec4 -> IO CFloat
graphene_vec4_get_y Ptr Vec4
v'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Vec4GetYMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo Vec4GetYMethodInfo Vec4 signature where
overloadedMethod = vec4GetY
#endif
foreign import ccall "graphene_vec4_get_z" graphene_vec4_get_z ::
Ptr Vec4 ->
IO CFloat
vec4GetZ ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m Float
vec4GetZ :: Vec4 -> m Float
vec4GetZ Vec4
v = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
CFloat
result <- Ptr Vec4 -> IO CFloat
graphene_vec4_get_z Ptr Vec4
v'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Vec4GetZMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo Vec4GetZMethodInfo Vec4 signature where
overloadedMethod = vec4GetZ
#endif
foreign import ccall "graphene_vec4_init" graphene_vec4_init ::
Ptr Vec4 ->
CFloat ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr Vec4)
vec4Init ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Float
-> Float
-> Float
-> Float
-> m Vec4
vec4Init :: Vec4 -> Float -> Float -> Float -> Float -> m Vec4
vec4Init Vec4
v Float
x Float
y Float
z Float
w = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
let x' :: CFloat
x' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
x
let y' :: CFloat
y' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
y
let z' :: CFloat
z' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
z
let w' :: CFloat
w' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
w
Ptr Vec4
result <- Ptr Vec4 -> CFloat -> CFloat -> CFloat -> CFloat -> IO (Ptr Vec4)
graphene_vec4_init Ptr Vec4
v' CFloat
x' CFloat
y' CFloat
z' CFloat
w'
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4Init" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
data Vec4InitMethodInfo
instance (signature ~ (Float -> Float -> Float -> Float -> m Vec4), MonadIO m) => O.MethodInfo Vec4InitMethodInfo Vec4 signature where
overloadedMethod = vec4Init
#endif
foreign import ccall "graphene_vec4_init_from_float" graphene_vec4_init_from_float ::
Ptr Vec4 ->
Ptr CFloat ->
IO (Ptr Vec4)
vec4InitFromFloat ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> [Float]
-> m Vec4
vec4InitFromFloat :: Vec4 -> [Float] -> m Vec4
vec4InitFromFloat Vec4
v [Float]
src = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr CFloat
src' <- ((Float -> CFloat) -> [Float] -> IO (Ptr CFloat)
forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b)
packMapStorableArray Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac) [Float]
src
Ptr Vec4
result <- Ptr Vec4 -> Ptr CFloat -> IO (Ptr Vec4)
graphene_vec4_init_from_float Ptr Vec4
v' Ptr CFloat
src'
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4InitFromFloat" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
src'
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
data Vec4InitFromFloatMethodInfo
instance (signature ~ ([Float] -> m Vec4), MonadIO m) => O.MethodInfo Vec4InitFromFloatMethodInfo Vec4 signature where
overloadedMethod = vec4InitFromFloat
#endif
foreign import ccall "graphene_vec4_init_from_vec2" graphene_vec4_init_from_vec2 ::
Ptr Vec4 ->
Ptr Graphene.Vec2.Vec2 ->
CFloat ->
CFloat ->
IO (Ptr Vec4)
vec4InitFromVec2 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Graphene.Vec2.Vec2
-> Float
-> Float
-> m Vec4
vec4InitFromVec2 :: Vec4 -> Vec2 -> Float -> Float -> m Vec4
vec4InitFromVec2 Vec4
v Vec2
src Float
z Float
w = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec2
src' <- Vec2 -> IO (Ptr Vec2)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec2
src
let z' :: CFloat
z' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
z
let w' :: CFloat
w' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
w
Ptr Vec4
result <- Ptr Vec4 -> Ptr Vec2 -> CFloat -> CFloat -> IO (Ptr Vec4)
graphene_vec4_init_from_vec2 Ptr Vec4
v' Ptr Vec2
src' CFloat
z' CFloat
w'
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4InitFromVec2" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec2 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec2
src
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
data Vec4InitFromVec2MethodInfo
instance (signature ~ (Graphene.Vec2.Vec2 -> Float -> Float -> m Vec4), MonadIO m) => O.MethodInfo Vec4InitFromVec2MethodInfo Vec4 signature where
overloadedMethod = vec4InitFromVec2
#endif
foreign import ccall "graphene_vec4_init_from_vec3" graphene_vec4_init_from_vec3 ::
Ptr Vec4 ->
Ptr Graphene.Vec3.Vec3 ->
CFloat ->
IO (Ptr Vec4)
vec4InitFromVec3 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Graphene.Vec3.Vec3
-> Float
-> m Vec4
vec4InitFromVec3 :: Vec4 -> Vec3 -> Float -> m Vec4
vec4InitFromVec3 Vec4
v Vec3
src Float
w = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec3
src' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
src
let w' :: CFloat
w' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
w
Ptr Vec4
result <- Ptr Vec4 -> Ptr Vec3 -> CFloat -> IO (Ptr Vec4)
graphene_vec4_init_from_vec3 Ptr Vec4
v' Ptr Vec3
src' CFloat
w'
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4InitFromVec3" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
src
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
data Vec4InitFromVec3MethodInfo
instance (signature ~ (Graphene.Vec3.Vec3 -> Float -> m Vec4), MonadIO m) => O.MethodInfo Vec4InitFromVec3MethodInfo Vec4 signature where
overloadedMethod = vec4InitFromVec3
#endif
foreign import ccall "graphene_vec4_init_from_vec4" graphene_vec4_init_from_vec4 ::
Ptr Vec4 ->
Ptr Vec4 ->
IO (Ptr Vec4)
vec4InitFromVec4 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m Vec4
vec4InitFromVec4 :: Vec4 -> Vec4 -> m Vec4
vec4InitFromVec4 Vec4
v Vec4
src = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec4
src' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
src
Ptr Vec4
result <- Ptr Vec4 -> Ptr Vec4 -> IO (Ptr Vec4)
graphene_vec4_init_from_vec4 Ptr Vec4
v' Ptr Vec4
src'
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4InitFromVec4" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
src
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
data Vec4InitFromVec4MethodInfo
instance (signature ~ (Vec4 -> m Vec4), MonadIO m) => O.MethodInfo Vec4InitFromVec4MethodInfo Vec4 signature where
overloadedMethod = vec4InitFromVec4
#endif
foreign import ccall "graphene_vec4_interpolate" graphene_vec4_interpolate ::
Ptr Vec4 ->
Ptr Vec4 ->
CDouble ->
Ptr Vec4 ->
IO ()
vec4Interpolate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> Double
-> m (Vec4)
vec4Interpolate :: Vec4 -> Vec4 -> Double -> m Vec4
vec4Interpolate Vec4
v1 Vec4
v2 Double
factor = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v1' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v1
Ptr Vec4
v2' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v2
let factor' :: CDouble
factor' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
factor
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> CDouble -> Ptr Vec4 -> IO ()
graphene_vec4_interpolate Ptr Vec4
v1' Ptr Vec4
v2' CDouble
factor' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v1
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v2
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4InterpolateMethodInfo
instance (signature ~ (Vec4 -> Double -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4InterpolateMethodInfo Vec4 signature where
overloadedMethod = vec4Interpolate
#endif
foreign import ccall "graphene_vec4_length" graphene_vec4_length ::
Ptr Vec4 ->
IO CFloat
vec4Length ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m Float
vec4Length :: Vec4 -> m Float
vec4Length Vec4
v = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
CFloat
result <- Ptr Vec4 -> IO CFloat
graphene_vec4_length Ptr Vec4
v'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Vec4LengthMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.MethodInfo Vec4LengthMethodInfo Vec4 signature where
overloadedMethod = vec4Length
#endif
foreign import ccall "graphene_vec4_max" graphene_vec4_max ::
Ptr Vec4 ->
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Max ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m (Vec4)
vec4Max :: Vec4 -> Vec4 -> m Vec4
vec4Max Vec4
a Vec4
b = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
a' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
a
Ptr Vec4
b' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
b
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_max Ptr Vec4
a' Ptr Vec4
b' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
a
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
b
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4MaxMethodInfo
instance (signature ~ (Vec4 -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4MaxMethodInfo Vec4 signature where
overloadedMethod = vec4Max
#endif
foreign import ccall "graphene_vec4_min" graphene_vec4_min ::
Ptr Vec4 ->
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Min ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m (Vec4)
vec4Min :: Vec4 -> Vec4 -> m Vec4
vec4Min Vec4
a Vec4
b = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
a' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
a
Ptr Vec4
b' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
b
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_min Ptr Vec4
a' Ptr Vec4
b' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
a
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
b
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4MinMethodInfo
instance (signature ~ (Vec4 -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4MinMethodInfo Vec4 signature where
overloadedMethod = vec4Min
#endif
foreign import ccall "graphene_vec4_multiply" graphene_vec4_multiply ::
Ptr Vec4 ->
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Multiply ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m (Vec4)
vec4Multiply :: Vec4 -> Vec4 -> m Vec4
vec4Multiply Vec4
a Vec4
b = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
a' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
a
Ptr Vec4
b' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
b
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_multiply Ptr Vec4
a' Ptr Vec4
b' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
a
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
b
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4MultiplyMethodInfo
instance (signature ~ (Vec4 -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4MultiplyMethodInfo Vec4 signature where
overloadedMethod = vec4Multiply
#endif
foreign import ccall "graphene_vec4_near" graphene_vec4_near ::
Ptr Vec4 ->
Ptr Vec4 ->
CFloat ->
IO CInt
vec4Near ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> Float
-> m Bool
vec4Near :: Vec4 -> Vec4 -> Float -> m Bool
vec4Near Vec4
v1 Vec4
v2 Float
epsilon = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v1' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v1
Ptr Vec4
v2' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v2
let epsilon' :: CFloat
epsilon' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
epsilon
CInt
result <- Ptr Vec4 -> Ptr Vec4 -> CFloat -> IO CInt
graphene_vec4_near Ptr Vec4
v1' Ptr Vec4
v2' CFloat
epsilon'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v1
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data Vec4NearMethodInfo
instance (signature ~ (Vec4 -> Float -> m Bool), MonadIO m) => O.MethodInfo Vec4NearMethodInfo Vec4 signature where
overloadedMethod = vec4Near
#endif
foreign import ccall "graphene_vec4_negate" graphene_vec4_negate ::
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Negate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m (Vec4)
vec4Negate :: Vec4 -> m Vec4
vec4Negate Vec4
v = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_negate Ptr Vec4
v' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4NegateMethodInfo
instance (signature ~ (m (Vec4)), MonadIO m) => O.MethodInfo Vec4NegateMethodInfo Vec4 signature where
overloadedMethod = vec4Negate
#endif
foreign import ccall "graphene_vec4_normalize" graphene_vec4_normalize ::
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Normalize ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> m (Vec4)
vec4Normalize :: Vec4 -> m Vec4
vec4Normalize Vec4
v = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_normalize Ptr Vec4
v' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4NormalizeMethodInfo
instance (signature ~ (m (Vec4)), MonadIO m) => O.MethodInfo Vec4NormalizeMethodInfo Vec4 signature where
overloadedMethod = vec4Normalize
#endif
foreign import ccall "graphene_vec4_scale" graphene_vec4_scale ::
Ptr Vec4 ->
CFloat ->
Ptr Vec4 ->
IO ()
vec4Scale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Float
-> m (Vec4)
vec4Scale :: Vec4 -> Float -> m Vec4
vec4Scale Vec4
v Float
factor = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
v' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
v
let factor' :: CFloat
factor' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factor
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> CFloat -> Ptr Vec4 -> IO ()
graphene_vec4_scale Ptr Vec4
v' CFloat
factor' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
v
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4ScaleMethodInfo
instance (signature ~ (Float -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4ScaleMethodInfo Vec4 signature where
overloadedMethod = vec4Scale
#endif
foreign import ccall "graphene_vec4_subtract" graphene_vec4_subtract ::
Ptr Vec4 ->
Ptr Vec4 ->
Ptr Vec4 ->
IO ()
vec4Subtract ::
(B.CallStack.HasCallStack, MonadIO m) =>
Vec4
-> Vec4
-> m (Vec4)
vec4Subtract :: Vec4 -> Vec4 -> m Vec4
vec4Subtract Vec4
a Vec4
b = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
a' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
a
Ptr Vec4
b' <- Vec4 -> IO (Ptr Vec4)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec4
b
Ptr Vec4
res <- Int -> IO (Ptr Vec4)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Vec4)
Ptr Vec4 -> Ptr Vec4 -> Ptr Vec4 -> IO ()
graphene_vec4_subtract Ptr Vec4
a' Ptr Vec4
b' Ptr Vec4
res
Vec4
res' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
res
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
a
Vec4 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec4
b
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
res'
#if defined(ENABLE_OVERLOADING)
data Vec4SubtractMethodInfo
instance (signature ~ (Vec4 -> m (Vec4)), MonadIO m) => O.MethodInfo Vec4SubtractMethodInfo Vec4 signature where
overloadedMethod = vec4Subtract
#endif
foreign import ccall "graphene_vec4_one" graphene_vec4_one ::
IO (Ptr Vec4)
vec4One ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Vec4
vec4One :: m Vec4
vec4One = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
result <- IO (Ptr Vec4)
graphene_vec4_one
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4One" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_vec4_w_axis" graphene_vec4_w_axis ::
IO (Ptr Vec4)
vec4WAxis ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Vec4
vec4WAxis :: m Vec4
vec4WAxis = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
result <- IO (Ptr Vec4)
graphene_vec4_w_axis
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4WAxis" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_vec4_x_axis" graphene_vec4_x_axis ::
IO (Ptr Vec4)
vec4XAxis ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Vec4
vec4XAxis :: m Vec4
vec4XAxis = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
result <- IO (Ptr Vec4)
graphene_vec4_x_axis
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4XAxis" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_vec4_y_axis" graphene_vec4_y_axis ::
IO (Ptr Vec4)
vec4YAxis ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Vec4
vec4YAxis :: m Vec4
vec4YAxis = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
result <- IO (Ptr Vec4)
graphene_vec4_y_axis
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4YAxis" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_vec4_z_axis" graphene_vec4_z_axis ::
IO (Ptr Vec4)
vec4ZAxis ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Vec4
vec4ZAxis :: m Vec4
vec4ZAxis = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
result <- IO (Ptr Vec4)
graphene_vec4_z_axis
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4ZAxis" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_vec4_zero" graphene_vec4_zero ::
IO (Ptr Vec4)
vec4Zero ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Vec4
vec4Zero :: m Vec4
vec4Zero = IO Vec4 -> m Vec4
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec4 -> m Vec4) -> IO Vec4 -> m Vec4
forall a b. (a -> b) -> a -> b
$ do
Ptr Vec4
result <- IO (Ptr Vec4)
graphene_vec4_zero
Text -> Ptr Vec4 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"vec4Zero" Ptr Vec4
result
Vec4
result' <- ((ManagedPtr Vec4 -> Vec4) -> Ptr Vec4 -> IO Vec4
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Vec4 -> Vec4
Vec4) Ptr Vec4
result
Vec4 -> IO Vec4
forall (m :: * -> *) a. Monad m => a -> m a
return Vec4
result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveVec4Method (t :: Symbol) (o :: *) :: * where
ResolveVec4Method "add" o = Vec4AddMethodInfo
ResolveVec4Method "divide" o = Vec4DivideMethodInfo
ResolveVec4Method "dot" o = Vec4DotMethodInfo
ResolveVec4Method "equal" o = Vec4EqualMethodInfo
ResolveVec4Method "free" o = Vec4FreeMethodInfo
ResolveVec4Method "init" o = Vec4InitMethodInfo
ResolveVec4Method "initFromFloat" o = Vec4InitFromFloatMethodInfo
ResolveVec4Method "initFromVec2" o = Vec4InitFromVec2MethodInfo
ResolveVec4Method "initFromVec3" o = Vec4InitFromVec3MethodInfo
ResolveVec4Method "initFromVec4" o = Vec4InitFromVec4MethodInfo
ResolveVec4Method "interpolate" o = Vec4InterpolateMethodInfo
ResolveVec4Method "length" o = Vec4LengthMethodInfo
ResolveVec4Method "max" o = Vec4MaxMethodInfo
ResolveVec4Method "min" o = Vec4MinMethodInfo
ResolveVec4Method "multiply" o = Vec4MultiplyMethodInfo
ResolveVec4Method "near" o = Vec4NearMethodInfo
ResolveVec4Method "negate" o = Vec4NegateMethodInfo
ResolveVec4Method "normalize" o = Vec4NormalizeMethodInfo
ResolveVec4Method "scale" o = Vec4ScaleMethodInfo
ResolveVec4Method "subtract" o = Vec4SubtractMethodInfo
ResolveVec4Method "getW" o = Vec4GetWMethodInfo
ResolveVec4Method "getX" o = Vec4GetXMethodInfo
ResolveVec4Method "getXy" o = Vec4GetXyMethodInfo
ResolveVec4Method "getXyz" o = Vec4GetXyzMethodInfo
ResolveVec4Method "getY" o = Vec4GetYMethodInfo
ResolveVec4Method "getZ" o = Vec4GetZMethodInfo
ResolveVec4Method l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVec4Method t Vec4, O.MethodInfo info Vec4 p) => OL.IsLabel t (Vec4 -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif