bullet-0.2.3: A wrapper for the Bullet physics engine.

Safe HaskellNone

Physics.Bullet.Raw.C2HS

Contents

Synopsis

Re-export the language-independent component of the FFI

module Foreign

Re-export the C language component of the FFI

module Foreign.C

Composite marshalling functions

withIntConv :: (Storable b, Integral a, Integral b) => a -> (Ptr b -> IO c) -> IO cSource

withFloatConv :: (Storable b, RealFloat a, RealFloat b) => a -> (Ptr b -> IO c) -> IO cSource

withBool :: (Integral a, Storable a) => Bool -> (Ptr a -> IO b) -> IO bSource

withEnum :: (Enum a, Integral b, Storable b) => a -> (Ptr b -> IO c) -> IO cSource

peekEnum :: (Enum a, Integral b, Storable b) => Ptr b -> IO aSource

Conditional results using Maybe

nothingIf :: (a -> Bool) -> (a -> b) -> a -> Maybe bSource

nothingIfNull :: (Ptr a -> b) -> Ptr a -> Maybe bSource

Instance for special casing null pointers.

Bit masks

combineBitMasks :: (Enum a, Bits b, Num b) => [a] -> bSource

containsBitMask :: (Bits a, Enum b, Num a) => a -> b -> BoolSource

extractBitMasks :: (Bits a, Enum b, Bounded b, Num a) => a -> [b]Source

Given a bit pattern, yield all bit masks that it contains.

  • This does *not* attempt to compute a minimal set of bit masks that when combined yield the bit pattern, instead all contained bit masks are produced.

Conversion between C and Haskell types

cIntConv :: (Integral a, Integral b) => a -> bSource

Integral conversion

cFloatConv :: (RealFloat a, RealFloat b) => a -> bSource

Floating conversion

cToBool :: (Eq a, Num a) => a -> BoolSource

Obtain Haskell Bool from C value.

cFromBool :: Num a => Bool -> aSource

Obtain C value from Haskell Bool.

cToEnum :: (Integral i, Enum e) => i -> eSource

Convert a C enumeration to Haskell.

cFromEnum :: (Enum e, Integral i) => e -> iSource

Convert a Haskell enumeration to C.