module Box2D.Recording
( create
, destroy
, getData
, getSize
)
where
import Foreign
import Foreign.C.Types (CInt(..))
import Box2D.Tags (Recording)
foreign import ccall unsafe "b2CreateRecording"
c_b2CreateRecording :: CInt -> IO (Ptr Recording)
foreign import ccall unsafe "b2DestroyRecording"
c_b2DestroyRecording :: Ptr Recording -> IO ()
foreign import ccall unsafe "b2Recording_GetData"
c_b2Recording_GetData :: Ptr Recording -> IO (Ptr Word8)
foreign import ccall unsafe "b2Recording_GetSize"
c_b2Recording_GetSize :: Ptr Recording -> IO CInt
create
:: Int
-> IO (Ptr Recording)
create :: Int -> IO (Ptr Recording)
create Int
a0 =
CInt -> IO (Ptr Recording)
c_b2CreateRecording (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_b2DestroyRecording 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_b2Recording_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_b2Recording_GetSize Ptr Recording
a0)