packages feed

HGamer3D-SFML-Binding 0.1.7 → 0.1.8

raw patch · 20 files changed

+161/−378 lines, 20 filesdep −haskell98dep ~HGamer3D-Data

Dependencies removed: haskell98

Dependency ranges changed: HGamer3D-Data

Files

− C2HS.hs
@@ -1,238 +0,0 @@---  C->Haskell Compiler: Marshalling library
---
---  Copyright (c) [1999...2005] Manuel M T Chakravarty
---
---  Redistribution and use in source and binary forms, with or without
---  modification, are permitted provided that the following conditions are met:
--- 
---  1. Redistributions of source code must retain the above copyright notice,
---     this list of conditions and the following disclaimer. 
---  2. Redistributions in binary form must reproduce the above copyright
---     notice, this list of conditions and the following disclaimer in the
---     documentation and/or other materials provided with the distribution. 
---  3. The name of the author may not be used to endorse or promote products
---     derived from this software without specific prior written permission. 
---
---  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
---  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
---  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
---  NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
---  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
---  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---
---- Description ---------------------------------------------------------------
---
---  Language: Haskell 98
---
---  This module provides the marshaling routines for Haskell files produced by 
---  C->Haskell for binding to C library interfaces.  It exports all of the
---  low-level FFI (language-independent plus the C-specific parts) together
---  with the C->HS-specific higher-level marshalling routines.
---
-
-module C2HS (
-
-  -- * 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
-  withCStringLenIntConv, peekCStringLenIntConv, withIntConv, withFloatConv,
-  peekIntConv, peekFloatConv, withBool, peekBool, withEnum, peekEnum,
-
-  -- * Conditional results using 'Maybe'
-  nothingIf, nothingIfNull,
-
-  -- * Bit masks
-  combineBitMasks, containsBitMask, extractBitMasks,
-
-  -- * Conversion between C and Haskell types
-  cIntConv, cFloatConv, cToBool, cFromBool, cToEnum, cFromEnum
-) where 
-
-
-import Foreign
-import Foreign.C
-
-import Monad (liftM)
-
-
--- Composite marshalling functions
--- -------------------------------
-
--- Strings with explicit length
---
-withCStringLenIntConv :: Num n => String -> ((CString, n) -> IO a) -> IO a
-withCStringLenIntConv s f    = withCStringLen s $ \(p, n) -> f (p, fromIntegral n)
-
-peekCStringLenIntConv :: Integral n => (CString, n) -> IO String
-peekCStringLenIntConv (s, n) = peekCStringLen (s, fromIntegral n)
-
--- Marshalling of numerals
---
-
-withIntConv   :: (Storable b, Integral a, Integral b) 
-              => a -> (Ptr b -> IO c) -> IO c
-withIntConv    = with . fromIntegral
-
-withFloatConv :: (Storable b, RealFloat a, RealFloat b) 
-              => a -> (Ptr b -> IO c) -> IO c
-withFloatConv  = with . realToFrac
-
-peekIntConv   :: (Storable a, Integral a, Integral b) 
-              => Ptr a -> IO b
-peekIntConv    = liftM fromIntegral . peek
-
-peekFloatConv :: (Storable a, RealFloat a, RealFloat b) 
-              => Ptr a -> IO b
-peekFloatConv  = liftM realToFrac . peek
-
-
--- Everything else below is deprecated.
--- These functions are not used by code generated by c2hs.
-
-{-# DEPRECATED withBool        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED peekBool        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED withEnum        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED peekEnum        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED nothingIf       "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED nothingIfNull   "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED combineBitMasks "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED containsBitMask "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED extractBitMasks "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED cIntConv        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED cFloatConv      "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED cFromBool       "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED cToBool         "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED cToEnum         "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-{-# DEPRECATED cFromEnum       "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
-
-
--- Passing Booleans by reference
---
-
-withBool :: (Integral a, Storable a) => Bool -> (Ptr a -> IO b) -> IO b
-withBool  = with . fromBool
-
-peekBool :: (Integral a, Storable a) => Ptr a -> IO Bool
-peekBool  = liftM toBool . peek
-
-
--- Passing enums by reference
---
-
-withEnum :: (Enum a, Integral b, Storable b) => a -> (Ptr b -> IO c) -> IO c
-withEnum  = with . cFromEnum
-
-peekEnum :: (Enum a, Integral b, Storable b) => Ptr b -> IO a
-peekEnum  = liftM cToEnum . peek
-
-
--- Storing of 'Maybe' values
--- -------------------------
-
---TODO: kill off this orphan instance!
-
-instance Storable a => Storable (Maybe a) where
-  sizeOf    _ = sizeOf    (undefined :: Ptr ())
-  alignment _ = alignment (undefined :: Ptr ())
-
-  peek p = do
-             ptr <- peek (castPtr p)
-             if ptr == nullPtr
-               then return Nothing
-               else liftM Just $ peek ptr
-
-  poke p v = do
-               ptr <- case v of
-                        Nothing -> return nullPtr
-                        Just v' -> new v'
-               poke (castPtr p) ptr
-
-
--- Conditional results using 'Maybe'
--- ---------------------------------
-
--- Wrap the result into a 'Maybe' type.
---
--- * the predicate determines when the result is considered to be non-existing,
---   ie, it is represented by `Nothing'
---
--- * the second argument allows to map a result wrapped into `Just' to some
---   other domain
---
-nothingIf       :: (a -> Bool) -> (a -> b) -> a -> Maybe b
-nothingIf p f x  = if p x then Nothing else Just $ f x
-
--- |Instance for special casing null pointers.
---
-nothingIfNull :: (Ptr a -> b) -> Ptr a -> Maybe b
-nothingIfNull  = nothingIf (== nullPtr)
-
-
--- Support for bit masks
--- ---------------------
-
--- Given a list of enumeration values that represent bit masks, combine these
--- masks using bitwise disjunction.
---
-combineBitMasks :: (Enum a, Bits b) => [a] -> b
-combineBitMasks = foldl (.|.) 0 . map (fromIntegral . fromEnum)
-
--- Tests whether the given bit mask is contained in the given bit pattern
--- (i.e., all bits set in the mask are also set in the pattern).
---
-containsBitMask :: (Bits a, Enum b) => a -> b -> Bool
-bits `containsBitMask` bm = let bm' = fromIntegral . fromEnum $ bm
-                            in
-                            bm' .&. bits == bm'
-
--- |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.
---
-extractBitMasks :: (Bits a, Enum b, Bounded b) => a -> [b]
-extractBitMasks bits = 
-  [bm | bm <- [minBound..maxBound], bits `containsBitMask` bm]
-
-
--- Conversion routines
--- -------------------
-
--- |Integral conversion
---
-cIntConv :: (Integral a, Integral b) => a -> b
-cIntConv  = fromIntegral
-
--- |Floating conversion
---
-cFloatConv :: (RealFloat a, RealFloat b) => a -> b
-cFloatConv  = realToFrac
-
--- |Obtain C value from Haskell 'Bool'.
---
-cFromBool :: Num a => Bool -> a
-cFromBool  = fromBool
-
--- |Obtain Haskell 'Bool' from C value.
---
-cToBool :: Num a => a -> Bool
-cToBool  = toBool
-
--- |Convert a C enumeration to Haskell.
---
-cToEnum :: (Integral i, Enum e) => i -> e
-cToEnum  = toEnum . fromIntegral
-
--- |Convert a Haskell enumeration to C.
---
-cFromEnum :: (Enum e, Integral i) => e -> i
-cFromEnum  = fromIntegral . fromEnum
HGamer3D-SFML-Binding.cabal view
@@ -1,5 +1,5 @@ Name:                HGamer3D-SFML-Binding
-Version:             0.1.7
+Version:             0.1.8
 Synopsis:            Library to enable 3D game development for Haskell - SFML Bindings
 Description:         
    Library, to enable 3D game development for Haskell,
@@ -25,15 +25,15 @@ Extra-source-files:  Setup.hs, include/ClassJoystick.h, include/ClassKeyboard.h, include/ClassListener.h, include/ClassMouse.h, include/ClassMouseHG3D.h, include/ClassMusic.h, include/ClassPtr.h, include/ClassSound.h, include/ClassSoundBuffer.h, include/ClassSoundSource.h, include/ClassSoundStream.h, include/EnumJoystickAxis.h, include/EnumKey.h, include/EnumMouseButton.h, include/EnumSoundSourceStatus.h, include/SFMLDllDefines.h, include/StructHG3DClass.h
 
 Library
-  Build-Depends:     base >= 3 && < 5, HGamer3D-Data >= 0.1.7
+  Build-Depends:     base >= 3 && < 5, HGamer3D-Data >= 0.1.8
 
-  Exposed-modules:   HGamer3D.Bindings.SFML.ClassPtr, HGamer3D.Bindings.SFML.StructHG3DClass, HGamer3D.Bindings.SFML.Utils, HGamer3D.Bindings.SFML.EnumJoystickAxis, HGamer3D.Bindings.SFML.EnumKey, HGamer3D.Bindings.SFML.EnumMouseButton, HGamer3D.Bindings.SFML.EnumSoundSourceStatus, HGamer3D.Bindings.SFML.ClassJoystick, HGamer3D.Bindings.SFML.ClassKeyboard, HGamer3D.Bindings.SFML.ClassListener, HGamer3D.Bindings.SFML.ClassMouse, HGamer3D.Bindings.SFML.ClassMouseHG3D, HGamer3D.Bindings.SFML.ClassMusic, HGamer3D.Bindings.SFML.ClassSound, HGamer3D.Bindings.SFML.ClassSoundBuffer, HGamer3D.Bindings.SFML.ClassSoundSource, HGamer3D.Bindings.SFML.ClassSoundStream
-  Other-modules:     C2HS 
+  Exposed-modules:   HGamer3D.Bindings.SFML.Utils, HGamer3D.Bindings.SFML.ClassPtr, HGamer3D.Bindings.SFML.StructHG3DClass, HGamer3D.Bindings.SFML.EnumJoystickAxis, HGamer3D.Bindings.SFML.EnumKey, HGamer3D.Bindings.SFML.EnumMouseButton, HGamer3D.Bindings.SFML.EnumSoundSourceStatus, HGamer3D.Bindings.SFML.ClassJoystick, HGamer3D.Bindings.SFML.ClassKeyboard, HGamer3D.Bindings.SFML.ClassListener, HGamer3D.Bindings.SFML.ClassMouse, HGamer3D.Bindings.SFML.ClassMouseHG3D, HGamer3D.Bindings.SFML.ClassMusic, HGamer3D.Bindings.SFML.ClassSound, HGamer3D.Bindings.SFML.ClassSoundBuffer, HGamer3D.Bindings.SFML.ClassSoundSource, HGamer3D.Bindings.SFML.ClassSoundStream
+  Other-modules:     
 
   ghc-options:       
   cc-options:        -Wno-attributes 
   hs-source-dirs:    .
   Include-dirs:      include
   Build-tools:       
-  build-depends:     haskell98
+  build-depends:     
   extra-libraries:   
HGamer3D/Bindings/SFML/ClassJoystick.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassJoystick where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,13 +42,13 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 import HGamer3D.Bindings.SFML.EnumJoystickAxis
-{-# LINE 45 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 
 -- | Check if a joystick is connected. 
 isConnected :: Int  -- ^ joystick - Index of the joystick to check
@@ -62,7 +60,7 @@   isConnected'_ a1' a2' >>= \res ->
   peekBoolUtil  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 
 -- | Return the number of buttons supported by a joystick.  - Details: If the joystick is not connected, this function returns 0.
 getButtonCount :: Int  -- ^ joystick
@@ -74,7 +72,7 @@   getButtonCount'_ a1' a2' >>= \res ->
   peekIntConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 56 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 54 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 
 -- | Check if a joystick supports a given axis.  - Details: If the joystick is not connected, this function returns false.
 hasAxis :: Int  -- ^ joystick
@@ -88,7 +86,7 @@   hasAxis'_ a1' a2' a3' >>= \res ->
   peekBoolUtil  a3'>>= \a3'' -> 
   return (a3'')
-{-# LINE 62 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 60 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 
 -- | Check if a joystick button is pressed.  - Details: If the joystick is not connected, this function returns false.
 isButtonPressed :: Int  -- ^ joystick
@@ -102,7 +100,7 @@   isButtonPressed'_ a1' a2' a3' >>= \res ->
   peekBoolUtil  a3'>>= \a3'' -> 
   return (a3'')
-{-# LINE 68 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 66 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 
 -- | Get the current position of a joystick axis.  - Details: If the joystick is not connected, this function returns 0.
 getAxisPosition :: Int  -- ^ joystick
@@ -116,7 +114,7 @@   getAxisPosition'_ a1' a2' a3' >>= \res ->
   peekFloatConv  a3'>>= \a3'' -> 
   return (a3'')
-{-# LINE 74 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 72 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 
 -- | Update the states of all joysticks.  - Details: This function is used internally by SFML, so you normally don't have to call it explicitely. However, you may need to call it if you have no window yet (or no window at all): in this case the joysticks states are not updated automatically. 
 update :: IO ()
@@ -124,7 +122,7 @@ update =
   update'_ >>= \res ->
   return ()
-{-# LINE 78 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
+{-# LINE 76 ".\\HGamer3D\\Bindings\\SFML\\ClassJoystick.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassJoystick.chs.h sfml_jst_isConnected"
HGamer3D/Bindings/SFML/ClassKeyboard.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassKeyboard where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,13 +42,13 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
 import HGamer3D.Bindings.SFML.EnumKey
-{-# LINE 45 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
+{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
 
 -- | Check if a key is pressed. 
 isKeyPressed :: EnumKey  -- ^ key - Key to check
@@ -62,7 +60,7 @@   isKeyPressed'_ a1' a2' >>= \res ->
   peekBoolUtil  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
+{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassKeyboard.chs.h sfml_kbd_isKeyPressed"
HGamer3D/Bindings/SFML/ClassListener.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassListener where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,11 +42,11 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
 
 -- | Change the global volume of all the sounds and musics.  - Details: The volume is a number between 0 and 100; it is combined with the individual volume of each sound / music. The default value for the volume is 100 (maximum).
 setGlobalVolume :: Float  -- ^ volume
@@ -58,7 +56,7 @@   let {a1' = realToFrac a1} in 
   setGlobalVolume'_ a1' >>= \res ->
   return ()
-{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
+{-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
 
 -- | Get the current value of the global volume.  - Details: setGlobalVolume
 getGlobalVolume :: IO (Float)
@@ -68,7 +66,7 @@   getGlobalVolume'_ a1' >>= \res ->
   peekFloatConv  a1'>>= \a1'' -> 
   return (a1'')
-{-# LINE 53 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
+{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
 
 -- | Set the position of the listener in the scene.  - Details: The default listener's position is (0, 0, 0).
 setPosition :: Float  -- ^ x
@@ -82,7 +80,7 @@   let {a3' = realToFrac a3} in 
   setPosition'_ a1' a2' a3' >>= \res ->
   return ()
-{-# LINE 59 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
+{-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
 
 -- | Set the orientation of the listener in the scene.  - Details: The orientation defines the 3D axes of the listener (left, up, front) in the scene. The orientation vector doesn't have to be normalized. The default listener's orientation is (0, 0, -1).
 setDirection :: Float  -- ^ x
@@ -96,7 +94,7 @@   let {a3' = realToFrac a3} in 
   setDirection'_ a1' a2' a3' >>= \res ->
   return ()
-{-# LINE 65 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
+{-# LINE 63 ".\\HGamer3D\\Bindings\\SFML\\ClassListener.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassListener.chs.h sfml_lst_setGlobalVolume"
HGamer3D/Bindings/SFML/ClassMouse.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassMouse where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,13 +42,13 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
 import HGamer3D.Bindings.SFML.EnumMouseButton
-{-# LINE 45 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
+{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
 
 -- | Check if a mouse button is pressed. 
 isButtonPressed :: EnumMouseButton  -- ^ button - Button to check
@@ -62,7 +60,7 @@   isButtonPressed'_ a1' a2' >>= \res ->
   peekBoolUtil  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
+{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassMouse.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassMouse.chs.h sfml_mse_isButtonPressed"
HGamer3D/Bindings/SFML/ClassMouseHG3D.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassMouseHG3D where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,11 +42,11 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
 
 -- | 
 getPosition :: IO (Int, Int)
@@ -60,7 +58,7 @@   peekIntConv  a1'>>= \a1'' -> 
   peekIntConv  a2'>>= \a2'' -> 
   return (a1'', a2'')
-{-# LINE 50 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
+{-# LINE 48 ".\\HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassMouseHG3D.chs.h sfml_mshg_getPosition"
HGamer3D/Bindings/SFML/ClassMusic.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassMusic where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,11 +42,11 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
 
 -- | Default constructor. 
 new :: IO (HG3DClass)
@@ -58,7 +56,7 @@   new'_ a1' >>= \res ->
   peek  a1'>>= \a1'' -> 
   return (a1'')
-{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
+{-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
 
 -- | Destructor. 
 delete :: HG3DClass  -- ^ classpointer - pointer of Class instance which is going to be deleted.
@@ -68,7 +66,7 @@   withHG3DClass a1 $ \a1' -> 
   delete'_ a1' >>= \res ->
   return ()
-{-# LINE 53 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
+{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
 
 -- | Open a music from an audio file.  - Details: This function doesn't start playing the music (call play()
 openFromFile :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -82,7 +80,7 @@   openFromFile'_ a1' a2' a3' >>= \res ->
   peekBoolUtil  a3'>>= \a3'' -> 
   return (a3'')
-{-# LINE 59 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
+{-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassMusic.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassMusic.chs.h sfml_msc_construct"
HGamer3D/Bindings/SFML/ClassPtr.hs view
@@ -32,45 +32,45 @@ 
 module HGamer3D.Bindings.SFML.ClassPtr where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
 import HGamer3D.Data.Colour
 import HGamer3D.Data.Angle
 
+import HGamer3D.Bindings.SFML.Utils
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 
 {- class ClassMouseHG3D -}
 type ClassMouseHG3D = Ptr (())
-{-# LINE 45 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassJoystick -}
 type ClassJoystick = Ptr (())
-{-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 46 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassKeyboard -}
 type ClassKeyboard = Ptr (())
-{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 48 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassListener -}
 type ClassListener = Ptr (())
-{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 50 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassMouse -}
 type ClassMouse = Ptr (())
-{-# LINE 53 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 52 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassMusic -}
 type ClassMusic = Ptr (())
-{-# LINE 55 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 54 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassSound -}
 type ClassSound = Ptr (())
-{-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 56 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassSoundBuffer -}
 type ClassSoundBuffer = Ptr (())
-{-# LINE 59 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 58 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassSoundSource -}
 type ClassSoundSource = Ptr (())
-{-# LINE 61 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 60 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
 {- class ClassSoundStream -}
 type ClassSoundStream = Ptr (())
-{-# LINE 63 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
+{-# LINE 62 ".\\HGamer3D\\Bindings\\SFML\\ClassPtr.chs" #-}
HGamer3D/Bindings/SFML/ClassSound.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassSound where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,11 +42,11 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Default constructor. 
 new :: IO (HG3DClass)
@@ -58,7 +56,7 @@   new'_ a1' >>= \res ->
   peek  a1'>>= \a1'' -> 
   return (a1'')
-{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Destructor. 
 delete :: HG3DClass  -- ^ classpointer - pointer of Class instance which is going to be deleted.
@@ -68,7 +66,7 @@   withHG3DClass a1 $ \a1' -> 
   delete'_ a1' >>= \res ->
   return ()
-{-# LINE 53 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Start or resume playing the sound.  - Details: This function starts the stream if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the sound is played.
 play :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -78,7 +76,7 @@   withHG3DClass a1 $ \a1' -> 
   play'_ a1' >>= \res ->
   return ()
-{-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 55 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Pause the sound.  - Details: This function pauses the sound if it was playing, otherwise (sound already paused or stopped) it has no effect.
 pause :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -88,7 +86,7 @@   withHG3DClass a1 $ \a1' -> 
   pause'_ a1' >>= \res ->
   return ()
-{-# LINE 61 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 59 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Stop playing the sound.  - Details: This function stops the sound if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike pause()
 stop :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -98,7 +96,7 @@   withHG3DClass a1 $ \a1' -> 
   stop'_ a1' >>= \res ->
   return ()
-{-# LINE 65 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 63 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Set the source buffer containing the audio data to play.  - Details: It is important to note that the sound buffer is not copied, thus the sf::SoundBuffer
 setBuffer :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -110,7 +108,7 @@   withHG3DClass a2 $ \a2' -> 
   setBuffer'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 70 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 68 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Set whether or not the sound should loop after reaching the end.  - Details: If set, the sound will restart from beginning after reaching the end and so on, until it is stopped or setLoop(false) is called. The default looping state for sound is false.
 setLoop :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -122,7 +120,7 @@   let {a2' = fromBool a2} in 
   setLoop'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 75 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 73 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Tell whether or not the sound is in loop mode.  - Details: setLoop
 getLoop :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -134,7 +132,7 @@   getLoop'_ a1' a2' >>= \res ->
   peekBoolUtil  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 80 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 78 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 -- | Reset the internal buffer of the sound.  - Details: This function is for internal use only, you don't have to use it. It is called by the sf::SoundBuffer
 resetBuffer :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -144,7 +142,7 @@   withHG3DClass a1 $ \a1' -> 
   resetBuffer'_ a1' >>= \res ->
   return ()
-{-# LINE 84 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
+{-# LINE 82 ".\\HGamer3D\\Bindings\\SFML\\ClassSound.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSound.chs.h sfml_snd_construct"
HGamer3D/Bindings/SFML/ClassSoundBuffer.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassSoundBuffer where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,11 +42,11 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 
 -- | Default constructor. 
 new :: IO (HG3DClass)
@@ -58,7 +56,7 @@   new'_ a1' >>= \res ->
   peek  a1'>>= \a1'' -> 
   return (a1'')
-{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 
 -- | Destructor. 
 delete :: HG3DClass  -- ^ classpointer - pointer of Class instance which is going to be deleted.
@@ -68,7 +66,7 @@   withHG3DClass a1 $ \a1' -> 
   delete'_ a1' >>= \res ->
   return ()
-{-# LINE 53 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 
 -- | Load the sound buffer from a file.  - Details: Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
 loadFromFile :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -82,7 +80,7 @@   loadFromFile'_ a1' a2' a3' >>= \res ->
   peekBoolUtil  a3'>>= \a3'' -> 
   return (a3'')
-{-# LINE 59 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 
 -- | Save the sound buffer to an audio file.  - Details: Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
 saveToFile :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -96,7 +94,7 @@   saveToFile'_ a1' a2' a3' >>= \res ->
   peekBoolUtil  a3'>>= \a3'' -> 
   return (a3'')
-{-# LINE 65 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 63 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 
 -- | Get the sample rate of the sound.  - Details: The sample rate is the number of samples played per second. The higher, the better the quality (for example, 44100 samples/s is CD quality).
 getSampleRate :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -108,7 +106,7 @@   getSampleRate'_ a1' a2' >>= \res ->
   peekIntConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 70 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 68 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 
 -- | Get the number of channels used by the sound.  - Details: If the sound is mono then the number of channels will be 1, 2 for stereo, etc.
 getChannelCount :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -120,7 +118,7 @@   getChannelCount'_ a1' a2' >>= \res ->
   peekIntConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 75 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
+{-# LINE 73 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundBuffer.chs.h sfml_snbf_construct"
HGamer3D/Bindings/SFML/ClassSoundSource.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassSoundSource where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,11 +42,11 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Destructor. 
 delete :: HG3DClass  -- ^ classpointer - pointer of Class instance which is going to be deleted.
@@ -58,7 +56,7 @@   withHG3DClass a1 $ \a1' -> 
   delete'_ a1' >>= \res ->
   return ()
-{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Set the pitch of the sound.  - Details: The pitch represents the perceived fundamental frequency of a sound; thus you can make a sound more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the sound as well. The default value for the pitch is 1.
 setPitch :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -70,7 +68,7 @@   let {a2' = realToFrac a2} in 
   setPitch'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 54 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 52 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Set the volume of the sound.  - Details: The volume is a value between 0 (mute) and 100 (full volume). The default value for the volume is 100.
 setVolume :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -82,7 +80,7 @@   let {a2' = realToFrac a2} in 
   setVolume'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 59 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Set the 3D position of the sound in the audio scene.  - Details: Only sounds with one channel (mono sounds) can be spatialized. The default position of a sound is (0, 0, 0).
 setPosition :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -98,7 +96,7 @@   let {a4' = realToFrac a4} in 
   setPosition'_ a1' a2' a3' a4' >>= \res ->
   return ()
-{-# LINE 66 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 64 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Make the sound's position relative to the listener or absolute.  - Details: Making a sound relative to the listener will ensure that it will always be played the same way regardless the position of the listener. This can be useful for non-spatialized sounds, sounds that are produced by the listener, or sounds attached to it. The default value is false (position is absolute).
 setRelativeToListener :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -110,7 +108,7 @@   let {a2' = fromBool a2} in 
   setRelativeToListener'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 71 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 69 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Set the minimum distance of the sound.  - Details: The "minimum distance" of a sound is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head
 -- of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1.
@@ -123,7 +121,7 @@   let {a2' = realToFrac a2} in 
   setMinDistance'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 76 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 74 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Set the attenuation factor of the sound.  - Details: The attenuation is a multiplicative factor which makes the sound more or less loud according to its distance from the listener. An attenuation of 0 will produce a non-attenuated sound, i.e. its volume will always be the same whether it is heard from near or from far. On the other hand, an attenuation value such as 100 will make the sound fade out very quickly as it gets further from the listener. The default value of the attenuation is 1.
 setAttenuation :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -135,7 +133,7 @@   let {a2' = realToFrac a2} in 
   setAttenuation'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 81 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 79 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Get the pitch of the sound.  - Details: setPitch
 getPitch :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -147,7 +145,7 @@   getPitch'_ a1' a2' >>= \res ->
   peekFloatConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 86 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 84 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Get the volume of the sound.  - Details: setVolume
 getVolume :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -159,7 +157,7 @@   getVolume'_ a1' a2' >>= \res ->
   peekFloatConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 91 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 89 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Tell whether the sound's position is relative to the listener or is absolute.  - Details: setRelativeToListener
 isRelativeToListener :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -171,7 +169,7 @@   isRelativeToListener'_ a1' a2' >>= \res ->
   peekBoolUtil  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 96 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 94 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Get the minimum distance of the sound.  - Details: setMinDistancegetAttenuation
 getMinDistance :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -183,7 +181,7 @@   getMinDistance'_ a1' a2' >>= \res ->
   peekFloatConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 101 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 99 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 -- | Get the attenuation factor of the sound.  - Details: setAttenuationgetMinDistance
 getAttenuation :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -195,7 +193,7 @@   getAttenuation'_ a1' a2' >>= \res ->
   peekFloatConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 106 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
+{-# LINE 104 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_destruct"
HGamer3D/Bindings/SFML/ClassSoundStream.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.ClassSoundStream where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,11 +42,11 @@ import HGamer3D.Data.Angle
 
 import HGamer3D.Bindings.SFML.Utils
-{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 import HGamer3D.Bindings.SFML.ClassPtr
-{-# LINE 43 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 import HGamer3D.Bindings.SFML.StructHG3DClass
-{-# LINE 44 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Destructor. 
 delete :: HG3DClass  -- ^ classpointer - pointer of Class instance which is going to be deleted.
@@ -58,7 +56,7 @@   withHG3DClass a1 $ \a1' -> 
   delete'_ a1' >>= \res ->
   return ()
-{-# LINE 49 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Start or resume playing the audio stream.  - Details: This function starts the stream if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the stream is played.
 play :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -68,7 +66,7 @@   withHG3DClass a1 $ \a1' -> 
   play'_ a1' >>= \res ->
   return ()
-{-# LINE 53 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 51 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Pause the audio stream.  - Details: This function pauses the stream if it was playing, otherwise (stream already paused or stopped) it has no effect.
 pause :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -78,7 +76,7 @@   withHG3DClass a1 $ \a1' -> 
   pause'_ a1' >>= \res ->
   return ()
-{-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 55 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Stop playing the audio stream.  - Details: This function stops the stream if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike pause()
 stop :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -88,7 +86,7 @@   withHG3DClass a1 $ \a1' -> 
   stop'_ a1' >>= \res ->
   return ()
-{-# LINE 61 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 59 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Return the number of channels of the stream.  - Details: 1 channel means a mono sound, 2 means stereo, etc.
 getChannelCount :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -100,7 +98,7 @@   getChannelCount'_ a1' a2' >>= \res ->
   peekIntConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 66 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 64 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Get the stream sample rate of the stream.  - Details: The sample rate is the number of audio samples played per second. The higher, the better the quality.
 getSampleRate :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -112,7 +110,7 @@   getSampleRate'_ a1' a2' >>= \res ->
   peekIntConv  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 71 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 69 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Set whether or not the stream should loop after reaching the end.  - Details: If set, the stream will restart from beginning after reaching the end and so on, until it is stopped or setLoop(false) is called. The default looping state for streams is false.
 setLoop :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -124,7 +122,7 @@   let {a2' = fromBool a2} in 
   setLoop'_ a1' a2' >>= \res ->
   return ()
-{-# LINE 76 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 74 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 -- | Tell whether or not the stream is in loop mode.  - Details: setLoop
 getLoop :: HG3DClass  -- ^ classpointer - pointer of Class instance from which this methods is called.
@@ -136,7 +134,7 @@   getLoop'_ a1' a2' >>= \res ->
   peekBoolUtil  a2'>>= \a2'' -> 
   return (a2'')
-{-# LINE 81 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
+{-# LINE 79 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs" #-}
 
 
 foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundStream.chs.h sfml_snst_destruct"
HGamer3D/Bindings/SFML/EnumJoystickAxis.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.EnumJoystickAxis where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
HGamer3D/Bindings/SFML/EnumKey.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.EnumKey where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
HGamer3D/Bindings/SFML/EnumMouseButton.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.EnumMouseButton where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
HGamer3D/Bindings/SFML/EnumSoundSourceStatus.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.EnumSoundSourceStatus where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
HGamer3D/Bindings/SFML/StructHG3DClass.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.StructHG3DClass where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -49,7 +47,7 @@ import HGamer3D.Data.HG3DClass
 
 type HG3DClassPtr = Ptr (HG3DClass)
-{-# LINE 48 ".\\HGamer3D\\Bindings\\SFML\\StructHG3DClass.chs" #-}
+{-# LINE 46 ".\\HGamer3D\\Bindings\\SFML\\StructHG3DClass.chs" #-}
 
 withHG3DClass :: HG3DClass -> (HG3DClassPtr -> IO b) -> IO b
 withHG3DClass = with
HGamer3D/Bindings/SFML/Utils.hs view
@@ -32,11 +32,9 @@ 
 module HGamer3D.Bindings.SFML.Utils where
 
-import C2HS
 import Foreign
 import Foreign.Ptr
 import Foreign.C
-import Monad         (liftM, liftM2)
 
 import HGamer3D.Data.HG3DClass
 import HGamer3D.Data.Vector
@@ -44,6 +42,37 @@ import HGamer3D.Data.Angle
 
 
+
+import Control.Monad (liftM)
+
+-- Strings with explicit length
+--
+withCStringLenIntConv :: Num n => String -> ((CString, n) -> IO a) -> IO a
+withCStringLenIntConv s f    = withCStringLen s $ \(p, n) -> f (p, fromIntegral n)
+
+peekCStringLenIntConv :: Integral n => (CString, n) -> IO String
+peekCStringLenIntConv (s, n) = peekCStringLen (s, fromIntegral n)
+
+-- Marshalling of numerals
+--
+
+withIntConv   :: (Storable b, Integral a, Integral b) 
+              => a -> (Ptr b -> IO c) -> IO c
+withIntConv    = with . fromIntegral
+
+withFloatConv :: (Storable b, RealFloat a, RealFloat b) 
+              => a -> (Ptr b -> IO c) -> IO c
+withFloatConv  = with . realToFrac
+
+peekIntConv   :: (Storable a, Integral a, Integral b) 
+              => Ptr a -> IO b
+peekIntConv    = liftM fromIntegral . peek
+
+peekFloatConv :: (Storable a, RealFloat a, RealFloat b) 
+              => Ptr a -> IO b
+peekFloatConv  = liftM realToFrac . peek
+
+
 -- String Conversion functions
 --
 
@@ -82,4 +111,26 @@ peekEnumUtil :: (Enum a, Integral b, Storable b) => Ptr b -> IO a
 peekEnumUtil  = liftM cToEnum . peek
 
+-- Conversion routines
+-- -------------------
+
+-- |Integral conversion
+--
+cIntConv :: (Integral a, Integral b) => a -> b
+cIntConv  = fromIntegral
+
+-- |Floating conversion
+--
+cFloatConv :: (RealFloat a, RealFloat b) => a -> b
+cFloatConv  = realToFrac
+
+-- |Convert a C enumeration to Haskell.
+--
+cToEnum :: (Integral i, Enum e) => i -> e
+cToEnum  = toEnum . fromIntegral
+
+-- |Convert a Haskell enumeration to C.
+--
+cFromEnum :: (Enum e, Integral i) => e -> i
+cFromEnum  = fromIntegral . fromEnum
 
include/SFMLDllDefines.h view
@@ -16,10 +16,10 @@ 
 // SFMLDllDefines.h
 
-#ifndef _HGamer3DSFML017_DLLDEFINES_H_
-#define _HGamer3DSFML017_DLLDEFINES_H_
+#ifndef _HGamer3DSFML018_DLLDEFINES_H_
+#define _HGamer3DSFML018_DLLDEFINES_H_
 
-/* Cmake will define HGamer3DSFML017_EXPORTS on Windows when it
+/* Cmake will define HGamer3DSFML018_EXPORTS on Windows when it
 configures to build a shared library. If you are going to use
 another build system on windows or create the visual studio
 projects by hand you need to define MyLibrary_EXPORTS when
@@ -29,13 +29,13 @@ // We are using the Visual Studio Compiler and building Shared libraries
 
 #if (defined (_WIN32)) && !(defined (__GNUC__)) 
-  #if defined(HGamer3DSFML017_EXPORTS)
+  #if defined(HGamer3DSFML018_EXPORTS)
     #define  SFML_LIB_EXPORT __declspec(dllexport)
   #else
     #define  SFML_LIB_EXPORT __declspec(dllimport)
-  #endif /* HGamer3DSFML017_EXPORTS */
+  #endif /* HGamer3DSFML018_EXPORTS */
 #else /* defined (_WIN32) */
  #define SFML_LIB_EXPORT
 #endif
 
-#endif /* _HGamer3DSFML017_DLLDEFINES_H_ */
+#endif /* _HGamer3DSFML018_DLLDEFINES_H_ */