h-raylib 4.5.0.3 → 4.5.0.4
raw patch · 3 files changed
+68/−67 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Raylib: c'changeDirectory :: CString -> IO CInt
+ Raylib: c'changeDirectory :: CString -> IO CBool
- Raylib: c'checkCollisionBoxSphere :: Ptr BoundingBox -> Ptr Vector3 -> CFloat -> IO CInt
+ Raylib: c'checkCollisionBoxSphere :: Ptr BoundingBox -> Ptr Vector3 -> CFloat -> IO CBool
- Raylib: c'checkCollisionBoxes :: Ptr BoundingBox -> Ptr BoundingBox -> IO CInt
+ Raylib: c'checkCollisionBoxes :: Ptr BoundingBox -> Ptr BoundingBox -> IO CBool
- Raylib: c'checkCollisionCircleRec :: Ptr Vector2 -> CFloat -> Ptr Rectangle -> IO CInt
+ Raylib: c'checkCollisionCircleRec :: Ptr Vector2 -> CFloat -> Ptr Rectangle -> IO CBool
- Raylib: c'checkCollisionCircles :: Ptr Vector2 -> CFloat -> Ptr Vector2 -> CFloat -> IO CInt
+ Raylib: c'checkCollisionCircles :: Ptr Vector2 -> CFloat -> Ptr Vector2 -> CFloat -> IO CBool
- Raylib: c'checkCollisionLines :: Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> IO CInt
+ Raylib: c'checkCollisionLines :: Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> IO CBool
- Raylib: c'checkCollisionPointCircle :: Ptr Vector2 -> Ptr Vector2 -> CFloat -> IO CInt
+ Raylib: c'checkCollisionPointCircle :: Ptr Vector2 -> Ptr Vector2 -> CFloat -> IO CBool
- Raylib: c'checkCollisionPointLine :: Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> CInt -> IO CInt
+ Raylib: c'checkCollisionPointLine :: Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> CInt -> IO CBool
- Raylib: c'checkCollisionPointRec :: Ptr Vector2 -> Ptr Rectangle -> IO CInt
+ Raylib: c'checkCollisionPointRec :: Ptr Vector2 -> Ptr Rectangle -> IO CBool
- Raylib: c'checkCollisionPointTriangle :: Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> IO CInt
+ Raylib: c'checkCollisionPointTriangle :: Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> Ptr Vector2 -> IO CBool
- Raylib: c'checkCollisionRecs :: Ptr Rectangle -> Ptr Rectangle -> IO CInt
+ Raylib: c'checkCollisionRecs :: Ptr Rectangle -> Ptr Rectangle -> IO CBool
- Raylib: c'checkCollisionSpheres :: Ptr Vector3 -> CFloat -> Ptr Vector3 -> CFloat -> IO CInt
+ Raylib: c'checkCollisionSpheres :: Ptr Vector3 -> CFloat -> Ptr Vector3 -> CFloat -> IO CBool
- Raylib: c'directoryExists :: CString -> IO CInt
+ Raylib: c'directoryExists :: CString -> IO CBool
- Raylib: c'exportDataAsCode :: CString -> CUInt -> CString -> IO CInt
+ Raylib: c'exportDataAsCode :: CString -> CUInt -> CString -> IO CBool
- Raylib: c'exportFontAsCode :: Ptr Font -> CString -> IO CInt
+ Raylib: c'exportFontAsCode :: Ptr Font -> CString -> IO CBool
- Raylib: c'exportImage :: Ptr Image -> CString -> IO CInt
+ Raylib: c'exportImage :: Ptr Image -> CString -> IO CBool
- Raylib: c'exportImageAsCode :: Ptr Image -> CString -> IO CInt
+ Raylib: c'exportImageAsCode :: Ptr Image -> CString -> IO CBool
- Raylib: c'exportMesh :: Ptr Mesh -> CString -> IO CInt
+ Raylib: c'exportMesh :: Ptr Mesh -> CString -> IO CBool
- Raylib: c'exportWave :: Ptr Wave -> CString -> IO CInt
+ Raylib: c'exportWave :: Ptr Wave -> CString -> IO CBool
- Raylib: c'exportWaveAsCode :: Ptr Wave -> CString -> IO CInt
+ Raylib: c'exportWaveAsCode :: Ptr Wave -> CString -> IO CBool
- Raylib: c'fileExists :: CString -> IO CInt
+ Raylib: c'fileExists :: CString -> IO CBool
- Raylib: c'getFileLength :: CString -> IO CInt
+ Raylib: c'getFileLength :: CString -> IO CBool
- Raylib: c'isAudioDeviceReady :: IO CInt
+ Raylib: c'isAudioDeviceReady :: IO CBool
- Raylib: c'isAudioStreamPlaying :: Ptr AudioStream -> IO CInt
+ Raylib: c'isAudioStreamPlaying :: Ptr AudioStream -> IO CBool
- Raylib: c'isAudioStreamProcessed :: Ptr AudioStream -> IO CInt
+ Raylib: c'isAudioStreamProcessed :: Ptr AudioStream -> IO CBool
- Raylib: c'isCursorHidden :: IO CInt
+ Raylib: c'isCursorHidden :: IO CBool
- Raylib: c'isCursorOnScreen :: IO CInt
+ Raylib: c'isCursorOnScreen :: IO CBool
- Raylib: c'isFileDropped :: IO CInt
+ Raylib: c'isFileDropped :: IO CBool
- Raylib: c'isFileExtension :: CString -> CString -> IO CInt
+ Raylib: c'isFileExtension :: CString -> CString -> IO CBool
- Raylib: c'isGamepadAvailable :: CInt -> IO CInt
+ Raylib: c'isGamepadAvailable :: CInt -> IO CBool
- Raylib: c'isGamepadButtonDown :: CInt -> CInt -> IO CInt
+ Raylib: c'isGamepadButtonDown :: CInt -> CInt -> IO CBool
- Raylib: c'isGamepadButtonPressed :: CInt -> CInt -> IO CInt
+ Raylib: c'isGamepadButtonPressed :: CInt -> CInt -> IO CBool
- Raylib: c'isGamepadButtonReleased :: CInt -> CInt -> IO CInt
+ Raylib: c'isGamepadButtonReleased :: CInt -> CInt -> IO CBool
- Raylib: c'isGamepadButtonUp :: CInt -> CInt -> IO CInt
+ Raylib: c'isGamepadButtonUp :: CInt -> CInt -> IO CBool
- Raylib: c'isGestureDetected :: CInt -> IO CInt
+ Raylib: c'isGestureDetected :: CInt -> IO CBool
- Raylib: c'isKeyDown :: CInt -> IO CInt
+ Raylib: c'isKeyDown :: CInt -> IO CBool
- Raylib: c'isKeyPressed :: CInt -> IO CInt
+ Raylib: c'isKeyPressed :: CInt -> IO CBool
- Raylib: c'isKeyReleased :: CInt -> IO CInt
+ Raylib: c'isKeyReleased :: CInt -> IO CBool
- Raylib: c'isKeyUp :: CInt -> IO CInt
+ Raylib: c'isKeyUp :: CInt -> IO CBool
- Raylib: c'isModelAnimationValid :: Ptr Model -> Ptr ModelAnimation -> IO CInt
+ Raylib: c'isModelAnimationValid :: Ptr Model -> Ptr ModelAnimation -> IO CBool
- Raylib: c'isMouseButtonDown :: CInt -> IO CInt
+ Raylib: c'isMouseButtonDown :: CInt -> IO CBool
- Raylib: c'isMouseButtonPressed :: CInt -> IO CInt
+ Raylib: c'isMouseButtonPressed :: CInt -> IO CBool
- Raylib: c'isMouseButtonReleased :: CInt -> IO CInt
+ Raylib: c'isMouseButtonReleased :: CInt -> IO CBool
- Raylib: c'isMouseButtonUp :: CInt -> IO CInt
+ Raylib: c'isMouseButtonUp :: CInt -> IO CBool
- Raylib: c'isMusicStreamPlaying :: Ptr Music -> IO CInt
+ Raylib: c'isMusicStreamPlaying :: Ptr Music -> IO CBool
- Raylib: c'isPathFile :: CString -> IO CInt
+ Raylib: c'isPathFile :: CString -> IO CBool
- Raylib: c'isSoundPlaying :: Ptr Sound -> IO CInt
+ Raylib: c'isSoundPlaying :: Ptr Sound -> IO CBool
- Raylib: c'isWindowFocused :: IO CInt
+ Raylib: c'isWindowFocused :: IO CBool
- Raylib: c'isWindowFullscreen :: IO CInt
+ Raylib: c'isWindowFullscreen :: IO CBool
- Raylib: c'isWindowHidden :: IO CInt
+ Raylib: c'isWindowHidden :: IO CBool
- Raylib: c'isWindowMaximized :: IO CInt
+ Raylib: c'isWindowMaximized :: IO CBool
- Raylib: c'isWindowMinimized :: IO CInt
+ Raylib: c'isWindowMinimized :: IO CBool
- Raylib: c'isWindowReady :: IO CInt
+ Raylib: c'isWindowReady :: IO CBool
- Raylib: c'isWindowResized :: IO CInt
+ Raylib: c'isWindowResized :: IO CBool
- Raylib: c'isWindowState :: CUInt -> IO CInt
+ Raylib: c'isWindowState :: CUInt -> IO CBool
- Raylib: c'saveFileData :: CString -> Ptr () -> CUInt -> IO CInt
+ Raylib: c'saveFileData :: CString -> Ptr () -> CUInt -> IO CBool
- Raylib: c'saveFileText :: CString -> CString -> IO CInt
+ Raylib: c'saveFileText :: CString -> CString -> IO CBool
- Raylib: c'windowShouldClose :: IO CInt
+ Raylib: c'windowShouldClose :: IO CBool
Files
- CHANGELOG.md +6/−0
- h-raylib.cabal +2/−2
- src/Raylib.hs +60/−65
+ CHANGELOG.md view
@@ -0,0 +1,6 @@+# h-raylib changelog + +## Version 4.5.0.4 +_13 November 2022_ +- Replaced CInt with CBool for functions that return booleans +- Removed Xext dependency (it is no longer required for Nix builds)
h-raylib.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: h-raylib -version: 4.5.0.3 +version: 4.5.0.4 synopsis: Raylib bindings for Haskell category: graphics description: @@ -13,6 +13,7 @@ maintainer: Anut extra-doc-files: README.md extra-source-files: + CHANGELOG.md lib/bindings.h raylib/src/*.h raylib/src/external/*.h @@ -103,7 +104,6 @@ Xcursor Xrandr Xi - Xext cc-options: -Wno-unused-result -DPLATFORM_DESKTOP
src/Raylib.hs view
@@ -20,7 +20,8 @@ withArrayLen, ) import Foreign.C - ( CChar (..), + ( CBool (..), + CChar (..), CDouble (..), CFloat (..), CInt (..), @@ -127,7 +128,7 @@ foreign import ccall safe "raylib.h WindowShouldClose" c'windowShouldClose :: - IO CInt + IO CBool windowShouldClose :: IO Bool windowShouldClose = toBool <$> c'windowShouldClose @@ -146,7 +147,7 @@ foreign import ccall safe "raylib.h IsWindowReady" c'isWindowReady :: - IO CInt + IO CBool isWindowReady :: IO Bool isWindowReady = toBool <$> c'isWindowReady @@ -157,7 +158,7 @@ foreign import ccall safe "raylib.h IsWindowFullscreen" c'isWindowFullscreen :: - IO CInt + IO CBool isWindowFullscreen :: IO Bool isWindowFullscreen = toBool <$> c'isWindowFullscreen @@ -168,7 +169,7 @@ foreign import ccall safe "raylib.h IsWindowHidden" c'isWindowHidden :: - IO CInt + IO CBool isWindowHidden :: IO Bool isWindowHidden = toBool <$> c'isWindowHidden @@ -179,7 +180,7 @@ foreign import ccall safe "raylib.h IsWindowMinimized" c'isWindowMinimized :: - IO CInt + IO CBool isWindowMinimized :: IO Bool isWindowMinimized = toBool <$> c'isWindowMinimized @@ -190,7 +191,7 @@ foreign import ccall safe "raylib.h IsWindowMaximized" c'isWindowMaximized :: - IO CInt + IO CBool isWindowMaximized :: IO Bool isWindowMaximized = toBool <$> c'isWindowMaximized @@ -201,7 +202,7 @@ foreign import ccall safe "raylib.h IsWindowFocused" c'isWindowFocused :: - IO CInt + IO CBool isWindowFocused :: IO Bool isWindowFocused = toBool <$> c'isWindowFocused @@ -212,7 +213,7 @@ foreign import ccall safe "raylib.h IsWindowResized" c'isWindowResized :: - IO CInt + IO CBool isWindowResized :: IO Bool isWindowResized = toBool <$> c'isWindowResized @@ -223,7 +224,7 @@ foreign import ccall safe "raylib.h IsWindowState" c'isWindowState :: - CUInt -> IO CInt + CUInt -> IO CBool isWindowState :: Integer -> IO Bool isWindowState flag = toBool <$> c'isWindowState (fromIntegral flag) @@ -611,7 +612,7 @@ foreign import ccall safe "raylib.h IsCursorHidden" c'isCursorHidden :: - IO CInt + IO CBool isCursorHidden :: IO Bool isCursorHidden = toBool <$> c'isCursorHidden @@ -638,7 +639,7 @@ foreign import ccall safe "raylib.h IsCursorOnScreen" c'isCursorOnScreen :: - IO CInt + IO CBool isCursorOnScreen :: IO Bool isCursorOnScreen = toBool <$> c'isCursorOnScreen @@ -1185,7 +1186,7 @@ foreign import ccall safe "raylib.h SaveFileData" c'saveFileData :: - CString -> Ptr () -> CUInt -> IO CInt + CString -> Ptr () -> CUInt -> IO CBool saveFileData :: (Storable a) => String -> Ptr a -> Integer -> IO Bool saveFileData fileName contents bytesToWrite = @@ -1197,7 +1198,7 @@ foreign import ccall safe "raylib.h ExportDataAsCode" c'exportDataAsCode :: - CString -> CUInt -> CString -> IO CInt + CString -> CUInt -> CString -> IO CBool exportDataAsCode :: String -> Integer -> String -> IO Bool exportDataAsCode contents size fileName = @@ -1231,7 +1232,7 @@ foreign import ccall safe "raylib.h SaveFileText" c'saveFileText :: - CString -> CString -> IO CInt + CString -> CString -> IO CBool saveFileText :: String -> String -> IO Bool saveFileText fileName text = toBool <$> withCString fileName (withCString text . c'saveFileText) @@ -1242,7 +1243,7 @@ foreign import ccall safe "raylib.h FileExists" c'fileExists :: - CString -> IO CInt + CString -> IO CBool fileExists :: String -> IO Bool fileExists fileName = toBool <$> withCString fileName c'fileExists @@ -1253,7 +1254,7 @@ foreign import ccall safe "raylib.h DirectoryExists" c'directoryExists :: - CString -> IO CInt + CString -> IO CBool directoryExists :: String -> IO Bool directoryExists dirPath = toBool <$> withCString dirPath c'directoryExists @@ -1264,7 +1265,7 @@ foreign import ccall safe "raylib.h IsFileExtension" c'isFileExtension :: - CString -> CString -> IO CInt + CString -> CString -> IO CBool isFileExtension :: String -> String -> IO Bool isFileExtension fileName ext = toBool <$> withCString fileName (withCString ext . c'isFileExtension) @@ -1275,7 +1276,7 @@ foreign import ccall safe "raylib.h GetFileLength" c'getFileLength :: - CString -> IO CInt + CString -> IO CBool getFileLength :: String -> IO Bool getFileLength fileName = toBool <$> withCString fileName c'getFileLength @@ -1363,7 +1364,7 @@ foreign import ccall safe "raylib.h ChangeDirectory" c'changeDirectory :: - CString -> IO CInt + CString -> IO CBool changeDirectory :: String -> IO Bool changeDirectory dir = toBool <$> withCString dir c'changeDirectory @@ -1374,7 +1375,7 @@ foreign import ccall safe "raylib.h IsPathFile" c'isPathFile :: - CString -> IO CInt + CString -> IO CBool isPathFile :: String -> IO Bool isPathFile path = toBool <$> withCString path c'isPathFile @@ -1413,7 +1414,7 @@ foreign import ccall safe "raylib.h IsFileDropped" c'isFileDropped :: - IO CInt + IO CBool isFileDropped :: IO Bool isFileDropped = toBool <$> c'isFileDropped @@ -1545,7 +1546,7 @@ foreign import ccall safe "raylib.h IsKeyPressed" c'isKeyPressed :: - CInt -> IO CInt + CInt -> IO CBool isKeyPressed :: Int -> IO Bool isKeyPressed key = toBool <$> c'isKeyPressed (fromIntegral key) @@ -1556,7 +1557,7 @@ foreign import ccall safe "raylib.h IsKeyDown" c'isKeyDown :: - CInt -> IO CInt + CInt -> IO CBool isKeyDown :: Int -> IO Bool isKeyDown key = toBool <$> c'isKeyDown (fromIntegral key) @@ -1567,7 +1568,7 @@ foreign import ccall safe "raylib.h IsKeyReleased" c'isKeyReleased :: - CInt -> IO CInt + CInt -> IO CBool isKeyReleased :: Int -> IO Bool isKeyReleased key = toBool <$> c'isKeyReleased (fromIntegral key) @@ -1578,7 +1579,7 @@ foreign import ccall safe "raylib.h IsKeyUp" c'isKeyUp :: - CInt -> IO CInt + CInt -> IO CBool isKeyUp :: Int -> IO Bool isKeyUp key = toBool <$> c'isKeyUp (fromIntegral key) @@ -1622,7 +1623,7 @@ foreign import ccall safe "raylib.h IsGamepadAvailable" c'isGamepadAvailable :: - CInt -> IO CInt + CInt -> IO CBool isGamepadAvailable :: Int -> IO Bool isGamepadAvailable gamepad = toBool <$> c'isGamepadAvailable (fromIntegral gamepad) @@ -1644,7 +1645,7 @@ foreign import ccall safe "raylib.h IsGamepadButtonPressed" c'isGamepadButtonPressed :: - CInt -> CInt -> IO CInt + CInt -> CInt -> IO CBool isGamepadButtonPressed :: Int -> Int -> IO Bool isGamepadButtonPressed gamepad button = toBool <$> c'isGamepadButtonPressed (fromIntegral gamepad) (fromIntegral button) @@ -1655,7 +1656,7 @@ foreign import ccall safe "raylib.h IsGamepadButtonDown" c'isGamepadButtonDown :: - CInt -> CInt -> IO CInt + CInt -> CInt -> IO CBool isGamepadButtonDown :: Int -> Int -> IO Bool isGamepadButtonDown gamepad button = toBool <$> c'isGamepadButtonDown (fromIntegral gamepad) (fromIntegral button) @@ -1666,7 +1667,7 @@ foreign import ccall safe "raylib.h IsGamepadButtonReleased" c'isGamepadButtonReleased :: - CInt -> CInt -> IO CInt + CInt -> CInt -> IO CBool isGamepadButtonReleased :: Int -> Int -> IO Bool isGamepadButtonReleased gamepad button = toBool <$> c'isGamepadButtonReleased (fromIntegral gamepad) (fromIntegral button) @@ -1677,7 +1678,7 @@ foreign import ccall safe "raylib.h IsGamepadButtonUp" c'isGamepadButtonUp :: - CInt -> CInt -> IO CInt + CInt -> CInt -> IO CBool isGamepadButtonUp :: Int -> Int -> IO Bool isGamepadButtonUp gamepad button = toBool <$> c'isGamepadButtonUp (fromIntegral gamepad) (fromIntegral button) @@ -1732,7 +1733,7 @@ foreign import ccall safe "raylib.h IsMouseButtonPressed" c'isMouseButtonPressed :: - CInt -> IO CInt + CInt -> IO CBool isMouseButtonPressed :: Int -> IO Bool isMouseButtonPressed button = toBool <$> c'isMouseButtonPressed (fromIntegral button) @@ -1743,7 +1744,7 @@ foreign import ccall safe "raylib.h IsMouseButtonDown" c'isMouseButtonDown :: - CInt -> IO CInt + CInt -> IO CBool isMouseButtonDown :: Int -> IO Bool isMouseButtonDown button = toBool <$> c'isMouseButtonDown (fromIntegral button) @@ -1754,7 +1755,7 @@ foreign import ccall safe "raylib.h IsMouseButtonReleased" c'isMouseButtonReleased :: - CInt -> IO CInt + CInt -> IO CBool isMouseButtonReleased :: Int -> IO Bool isMouseButtonReleased button = toBool <$> c'isMouseButtonReleased (fromIntegral button) @@ -1765,7 +1766,7 @@ foreign import ccall safe "raylib.h IsMouseButtonUp" c'isMouseButtonUp :: - CInt -> IO CInt + CInt -> IO CBool isMouseButtonUp :: Int -> IO Bool isMouseButtonUp button = toBool <$> c'isMouseButtonUp (fromIntegral button) @@ -1944,7 +1945,7 @@ foreign import ccall safe "raylib.h IsGestureDetected" c'isGestureDetected :: - CInt -> IO CInt + CInt -> IO CBool isGestureDetected :: Int -> IO Bool isGestureDetected gesture = toBool <$> c'isGestureDetected (fromIntegral gesture) @@ -2574,13 +2575,7 @@ p'drawPolyLinesEx :: FunPtr (Raylib.Types.Vector2 -> CInt -> CFloat -> CFloat -> CFloat -> Raylib.Types.Color -> IO ()) --- unsafePerformIO has been used with these collision functions --- It is OK to use to here because even though we are passing --- pointers as arguments, they are created through the `with` --- function, which ensures that all pointers are destroyed. --- See https://stackoverflow.com/a/10530919/17907758 - -foreign import ccall safe "bindings.h CheckCollisionRecs_" c'checkCollisionRecs :: Ptr Raylib.Types.Rectangle -> Ptr Raylib.Types.Rectangle -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionRecs_" c'checkCollisionRecs :: Ptr Raylib.Types.Rectangle -> Ptr Raylib.Types.Rectangle -> IO CBool checkCollisionRecs :: Raylib.Types.Rectangle -> Raylib.Types.Rectangle -> Bool checkCollisionRecs rec1 rec2 = unsafePerformIO $ toBool <$> with rec1 (with rec2 . c'checkCollisionRecs) @@ -2589,7 +2584,7 @@ p'checkCollisionRecs :: FunPtr (Raylib.Types.Rectangle -> Raylib.Types.Rectangle -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionCircles_" c'checkCollisionCircles :: Ptr Raylib.Types.Vector2 -> CFloat -> Ptr Raylib.Types.Vector2 -> CFloat -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionCircles_" c'checkCollisionCircles :: Ptr Raylib.Types.Vector2 -> CFloat -> Ptr Raylib.Types.Vector2 -> CFloat -> IO CBool checkCollisionCircles :: Raylib.Types.Vector2 -> Float -> Raylib.Types.Vector2 -> Float -> Bool checkCollisionCircles center1 radius1 center2 radius2 = @@ -2599,7 +2594,7 @@ p'checkCollisionCircles :: FunPtr (Raylib.Types.Vector2 -> CFloat -> Raylib.Types.Vector2 -> CFloat -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionCircleRec_" c'checkCollisionCircleRec :: Ptr Raylib.Types.Vector2 -> CFloat -> Ptr Raylib.Types.Rectangle -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionCircleRec_" c'checkCollisionCircleRec :: Ptr Raylib.Types.Vector2 -> CFloat -> Ptr Raylib.Types.Rectangle -> IO CBool checkCollisionCircleRec :: Raylib.Types.Vector2 -> Float -> Raylib.Types.Rectangle -> Bool checkCollisionCircleRec center radius rect = @@ -2609,7 +2604,7 @@ p'checkCollisionCircleRec :: FunPtr (Raylib.Types.Vector2 -> CFloat -> Raylib.Types.Rectangle -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionPointRec_" c'checkCollisionPointRec :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Rectangle -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionPointRec_" c'checkCollisionPointRec :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Rectangle -> IO CBool checkCollisionPointRec :: Raylib.Types.Vector2 -> Raylib.Types.Rectangle -> Bool checkCollisionPointRec point rect = @@ -2619,7 +2614,7 @@ p'checkCollisionPointRec :: FunPtr (Raylib.Types.Vector2 -> Raylib.Types.Rectangle -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionPointCircle_" c'checkCollisionPointCircle :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> CFloat -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionPointCircle_" c'checkCollisionPointCircle :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> CFloat -> IO CBool checkCollisionPointCircle :: Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Float -> Bool checkCollisionPointCircle point center radius = @@ -2629,7 +2624,7 @@ p'checkCollisionPointCircle :: FunPtr (Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> CFloat -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionPointTriangle_" c'checkCollisionPointTriangle :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionPointTriangle_" c'checkCollisionPointTriangle :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> IO CBool checkCollisionPointTriangle :: Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Bool checkCollisionPointTriangle point p1 p2 p3 = @@ -2639,7 +2634,7 @@ p'checkCollisionPointTriangle :: FunPtr (Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionLines_" c'checkCollisionLines :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionLines_" c'checkCollisionLines :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> IO CBool -- | If a collision is found, returns @Just collisionPoint@, otherwise returns @Nothing@ checkCollisionLines :: Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Maybe Raylib.Types.Vector2 @@ -2656,7 +2651,7 @@ p'checkCollisionLines :: FunPtr (Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionPointLine_" c'checkCollisionPointLine :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> CInt -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionPointLine_" c'checkCollisionPointLine :: Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> Ptr Raylib.Types.Vector2 -> CInt -> IO CBool checkCollisionPointLine :: Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Raylib.Types.Vector2 -> Int -> Bool checkCollisionPointLine point p1 p2 threshold = @@ -2753,7 +2748,7 @@ p'unloadImage :: FunPtr (Raylib.Types.Image -> IO ()) -foreign import ccall safe "bindings.h ExportImage_" c'exportImage :: Ptr Raylib.Types.Image -> CString -> IO CInt +foreign import ccall safe "bindings.h ExportImage_" c'exportImage :: Ptr Raylib.Types.Image -> CString -> IO CBool exportImage :: Raylib.Types.Image -> String -> IO Bool exportImage image fileName = toBool <$> with image (withCString fileName . c'exportImage) @@ -2762,7 +2757,7 @@ p'exportImage :: FunPtr (Raylib.Types.Image -> CString -> IO CInt) -foreign import ccall safe "bindings.h ExportImageAsCode_" c'exportImageAsCode :: Ptr Raylib.Types.Image -> CString -> IO CInt +foreign import ccall safe "bindings.h ExportImageAsCode_" c'exportImageAsCode :: Ptr Raylib.Types.Image -> CString -> IO CBool exportImageAsCode :: Raylib.Types.Image -> String -> IO Bool exportImageAsCode image fileName = @@ -3714,7 +3709,7 @@ p'unloadFont :: FunPtr (Raylib.Types.Font -> IO ()) -foreign import ccall safe "bindings.h ExportFontAsCode_" c'exportFontAsCode :: Ptr Raylib.Types.Font -> CString -> IO CInt +foreign import ccall safe "bindings.h ExportFontAsCode_" c'exportFontAsCode :: Ptr Raylib.Types.Font -> CString -> IO CBool exportFontAsCode :: Raylib.Types.Font -> String -> IO Bool exportFontAsCode font fileName = toBool <$> with font (withCString fileName . c'exportFontAsCode) @@ -4454,7 +4449,7 @@ p'drawMeshInstanced :: FunPtr (Raylib.Types.Mesh -> Raylib.Types.Material -> Ptr Raylib.Types.Matrix -> CInt -> IO ()) -foreign import ccall safe "bindings.h ExportMesh_" c'exportMesh :: Ptr Raylib.Types.Mesh -> CString -> IO CInt +foreign import ccall safe "bindings.h ExportMesh_" c'exportMesh :: Ptr Raylib.Types.Mesh -> CString -> IO CBool exportMesh :: Raylib.Types.Mesh -> String -> IO Bool exportMesh mesh fileName = toBool <$> with mesh (withCString fileName . c'exportMesh) @@ -4693,7 +4688,7 @@ p'unloadModelAnimations :: FunPtr (Ptr Raylib.Types.ModelAnimation -> CUInt -> IO ()) -foreign import ccall safe "bindings.h IsModelAnimationValid_" c'isModelAnimationValid :: Ptr Raylib.Types.Model -> Ptr Raylib.Types.ModelAnimation -> IO CInt +foreign import ccall safe "bindings.h IsModelAnimationValid_" c'isModelAnimationValid :: Ptr Raylib.Types.Model -> Ptr Raylib.Types.ModelAnimation -> IO CBool isModelAnimationValid :: Model -> ModelAnimation -> IO Bool isModelAnimationValid model animation = toBool <$> with model (with animation . c'isModelAnimationValid) @@ -4702,7 +4697,7 @@ p'isModelAnimationValid :: FunPtr (Raylib.Types.Model -> Raylib.Types.ModelAnimation -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionSpheres_" c'checkCollisionSpheres :: Ptr Raylib.Types.Vector3 -> CFloat -> Ptr Raylib.Types.Vector3 -> CFloat -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionSpheres_" c'checkCollisionSpheres :: Ptr Raylib.Types.Vector3 -> CFloat -> Ptr Raylib.Types.Vector3 -> CFloat -> IO CBool checkCollisionSpheres :: Vector3 -> Float -> Vector3 -> Float -> Bool checkCollisionSpheres center1 radius1 center2 radius2 = toBool $ unsafePerformIO (with center1 (\c1 -> with center2 (\c2 -> c'checkCollisionSpheres c1 (realToFrac radius1) c2 (realToFrac radius2)))) @@ -4711,7 +4706,7 @@ p'checkCollisionSpheres :: FunPtr (Raylib.Types.Vector3 -> CFloat -> Raylib.Types.Vector3 -> CFloat -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionBoxes_" c'checkCollisionBoxes :: Ptr Raylib.Types.BoundingBox -> Ptr Raylib.Types.BoundingBox -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionBoxes_" c'checkCollisionBoxes :: Ptr Raylib.Types.BoundingBox -> Ptr Raylib.Types.BoundingBox -> IO CBool checkCollisionBoxes :: BoundingBox -> BoundingBox -> Bool checkCollisionBoxes box1 box2 = toBool $ unsafePerformIO (with box1 (with box2 . c'checkCollisionBoxes)) @@ -4720,7 +4715,7 @@ p'checkCollisionBoxes :: FunPtr (Raylib.Types.BoundingBox -> Raylib.Types.BoundingBox -> IO CInt) -foreign import ccall safe "bindings.h CheckCollisionBoxSphere_" c'checkCollisionBoxSphere :: Ptr Raylib.Types.BoundingBox -> Ptr Raylib.Types.Vector3 -> CFloat -> IO CInt +foreign import ccall safe "bindings.h CheckCollisionBoxSphere_" c'checkCollisionBoxSphere :: Ptr Raylib.Types.BoundingBox -> Ptr Raylib.Types.Vector3 -> CFloat -> IO CBool checkCollisionBoxSphere :: BoundingBox -> Vector3 -> Float -> Bool checkCollisionBoxSphere box center radius = toBool $ unsafePerformIO (with box (\b -> with center (\c -> c'checkCollisionBoxSphere b c (realToFrac radius)))) @@ -4802,7 +4797,7 @@ foreign import ccall safe "raylib.h IsAudioDeviceReady" c'isAudioDeviceReady :: - IO CInt + IO CBool isAudioDeviceReady :: IO Bool isAudioDeviceReady = toBool <$> c'isAudioDeviceReady @@ -4885,7 +4880,7 @@ p'unloadSound :: FunPtr (Raylib.Types.Sound -> IO ()) -foreign import ccall safe "bindings.h ExportWave_" c'exportWave :: Ptr Raylib.Types.Wave -> CString -> IO CInt +foreign import ccall safe "bindings.h ExportWave_" c'exportWave :: Ptr Raylib.Types.Wave -> CString -> IO CBool exportWave :: Wave -> String -> IO Bool exportWave wave fileName = toBool <$> with wave (withCString fileName . c'exportWave) @@ -4894,7 +4889,7 @@ p'exportWave :: FunPtr (Raylib.Types.Wave -> CString -> IO CInt) -foreign import ccall safe "bindings.h ExportWaveAsCode_" c'exportWaveAsCode :: Ptr Raylib.Types.Wave -> CString -> IO CInt +foreign import ccall safe "bindings.h ExportWaveAsCode_" c'exportWaveAsCode :: Ptr Raylib.Types.Wave -> CString -> IO CBool exportWaveAsCode :: Wave -> String -> IO Bool exportWaveAsCode wave fileName = toBool <$> with wave (withCString fileName . c'exportWaveAsCode) @@ -4967,7 +4962,7 @@ p'getSoundsPlaying :: FunPtr (IO CInt) -foreign import ccall safe "bindings.h IsSoundPlaying_" c'isSoundPlaying :: Ptr Raylib.Types.Sound -> IO CInt +foreign import ccall safe "bindings.h IsSoundPlaying_" c'isSoundPlaying :: Ptr Raylib.Types.Sound -> IO CBool isSoundPlaying :: Sound -> IO Bool isSoundPlaying sound = toBool <$> with sound c'isSoundPlaying @@ -5099,7 +5094,7 @@ p'playMusicStream :: FunPtr (Raylib.Types.Music -> IO ()) -foreign import ccall safe "bindings.h IsMusicStreamPlaying_" c'isMusicStreamPlaying :: Ptr Raylib.Types.Music -> IO CInt +foreign import ccall safe "bindings.h IsMusicStreamPlaying_" c'isMusicStreamPlaying :: Ptr Raylib.Types.Music -> IO CBool isMusicStreamPlaying :: Music -> IO Bool isMusicStreamPlaying music = toBool <$> with music c'isMusicStreamPlaying @@ -5225,7 +5220,7 @@ p'updateAudioStream :: FunPtr (Raylib.Types.AudioStream -> Ptr () -> CInt -> IO ()) -foreign import ccall safe "bindings.h IsAudioStreamProcessed_" c'isAudioStreamProcessed :: Ptr Raylib.Types.AudioStream -> IO CInt +foreign import ccall safe "bindings.h IsAudioStreamProcessed_" c'isAudioStreamProcessed :: Ptr Raylib.Types.AudioStream -> IO CBool isAudioStreamProcessed :: AudioStream -> IO Bool isAudioStreamProcessed stream = toBool <$> with stream c'isAudioStreamProcessed @@ -5261,7 +5256,7 @@ p'resumeAudioStream :: FunPtr (Raylib.Types.AudioStream -> IO ()) -foreign import ccall safe "bindings.h IsAudioStreamPlaying_" c'isAudioStreamPlaying :: Ptr Raylib.Types.AudioStream -> IO CInt +foreign import ccall safe "bindings.h IsAudioStreamPlaying_" c'isAudioStreamPlaying :: Ptr Raylib.Types.AudioStream -> IO CBool isAudioStreamPlaying :: AudioStream -> IO Bool isAudioStreamPlaying stream = toBool <$> with stream c'isAudioStreamPlaying