module Box3D.Recording
( create
, destroy
, getData
, getSize
)
where
import Foreign
import Foreign.C.Types (CInt(..))
import Box3D.Tags (Recording)
foreign import ccall unsafe "b3CreateRecording"
c_b3CreateRecording :: CInt -> IO (Ptr Recording)
foreign import ccall unsafe "b3DestroyRecording"
c_b3DestroyRecording :: Ptr Recording -> IO ()
foreign import ccall unsafe "b3Recording_GetData"
c_b3Recording_GetData :: Ptr Recording -> IO (Ptr Word8)
foreign import ccall unsafe "b3Recording_GetSize"
c_b3Recording_GetSize :: Ptr Recording -> IO CInt
create
:: Int
-> IO (Ptr Recording)
create :: Int -> IO (Ptr Recording)
create Int
a0 =
CInt -> IO (Ptr Recording)
c_b3CreateRecording (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a0)
destroy
:: Ptr Recording
-> IO ()
destroy :: Ptr Recording -> IO ()
destroy Ptr Recording
a0 =
Ptr Recording -> IO ()
c_b3DestroyRecording Ptr Recording
a0
getData
:: Ptr Recording
-> IO (Ptr Word8)
getData :: Ptr Recording -> IO (Ptr Word8)
getData Ptr Recording
a0 =
Ptr Recording -> IO (Ptr Word8)
c_b3Recording_GetData Ptr Recording
a0
getSize
:: Ptr Recording
-> IO Int
getSize :: Ptr Recording -> IO Int
getSize Ptr Recording
a0 =
CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Ptr Recording -> IO CInt
c_b3Recording_GetSize Ptr Recording
a0)