mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-06-30 19:03:42 -04:00
Update to raylib 4.2 (#117)
Update bindings to use raylib 4.2.0. Review comments and utils.
This commit is contained in:
@ -13,13 +13,13 @@ namespace Raylib_cs
|
||||
/// </summary>
|
||||
public const string nativeLibName = "raylib";
|
||||
|
||||
public const string RAYLIB_VERSION = "4.0";
|
||||
public const string RAYLIB_VERSION = "4.2";
|
||||
|
||||
public const float DEG2RAD = MathF.PI / 180.0f;
|
||||
public const float RAD2DEG = 180.0f / MathF.PI;
|
||||
|
||||
/// <summary>
|
||||
/// Returns color with alpha applied, alpha goes from 0.0f to 1.0f<br/>
|
||||
/// Get color with alpha applied, alpha goes from 0.0f to 1.0f<br/>
|
||||
/// NOTE: Added for compatability with previous versions
|
||||
/// </summary>
|
||||
public static Color Fade(Color color, float alpha) => ColorAlpha(color, alpha);
|
||||
@ -122,6 +122,10 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowSize(int width, int height);
|
||||
|
||||
/// <summary>Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowOpacity(float opacity);
|
||||
|
||||
/// <summary>Get native window handle</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void* GetWindowHandle();
|
||||
@ -134,6 +138,14 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetScreenHeight();
|
||||
|
||||
/// <summary>Get current render width (it considers HiDPI)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetRenderWidth();
|
||||
|
||||
/// <summary>Get current render height (it considers HiDPI)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetRenderHeight();
|
||||
|
||||
/// <summary>Get number of connected monitors</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMonitorCount();
|
||||
@ -186,6 +198,14 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetClipboardText(sbyte* text);
|
||||
|
||||
/// <summary>Enable waiting for events on EndDrawing(), no automatic event polling</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EnableEventWaiting();
|
||||
|
||||
/// <summary>Disable waiting for events on EndDrawing(), automatic events polling</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DisableEventWaiting();
|
||||
|
||||
// Custom frame control functions
|
||||
// NOTE: Those functions are intended for advance users that want full control over the frame processing
|
||||
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
|
||||
@ -199,9 +219,9 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void PollInputEvents();
|
||||
|
||||
/// <summary>Wait for some milliseconds (halt program execution)</summary>
|
||||
/// <summary>Wait for some time (halt program execution)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void WaitTime(float ms);
|
||||
public static extern void WaitTime(double seconds);
|
||||
|
||||
// Cursor-related functions
|
||||
|
||||
@ -353,31 +373,31 @@ namespace Raylib_cs
|
||||
|
||||
// Screen-space-related functions
|
||||
|
||||
/// <summary>Returns a ray trace from mouse position</summary>
|
||||
/// <summary>Get a ray trace from mouse position</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Ray GetMouseRay(Vector2 mousePosition, Camera3D camera);
|
||||
|
||||
/// <summary>Returns camera transform matrix (view matrix)</summary>
|
||||
/// <summary>Get camera transform matrix (view matrix)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Matrix4x4 GetCameraMatrix(Camera3D camera);
|
||||
|
||||
/// <summary>Returns camera 2d transform matrix</summary>
|
||||
/// <summary>Get camera 2d transform matrix</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Matrix4x4 GetCameraMatrix2D(Camera2D camera);
|
||||
|
||||
/// <summary>Returns the screen space position for a 3d world space position</summary>
|
||||
/// <summary>Get the screen space position for a 3d world space position</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetWorldToScreen(Vector3 position, Camera3D camera);
|
||||
|
||||
/// <summary>Returns size position for a 3d world space position</summary>
|
||||
/// <summary>Get size position for a 3d world space position</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetWorldToScreenEx(Vector3 position, Camera3D camera, int width, int height);
|
||||
|
||||
/// <summary>Returns the screen space position for a 2d camera world space position</summary>
|
||||
/// <summary>Get the screen space position for a 2d camera world space position</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera);
|
||||
|
||||
/// <summary>Returns the world space position for a 2d camera screen space position</summary>
|
||||
/// <summary>Get the world space position for a 2d camera screen space position</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera);
|
||||
|
||||
@ -388,22 +408,22 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetTargetFPS(int fps);
|
||||
|
||||
/// <summary>Returns current FPS</summary>
|
||||
/// <summary>Get current FPS</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetFPS();
|
||||
|
||||
/// <summary>Returns time in seconds for last frame drawn</summary>
|
||||
/// <summary>Get time in seconds for last frame drawn</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetFrameTime();
|
||||
|
||||
/// <summary>Returns elapsed time in seconds since InitWindow()</summary>
|
||||
/// <summary>Get elapsed time in seconds since InitWindow()</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern double GetTime();
|
||||
|
||||
|
||||
// Misc. functions
|
||||
|
||||
/// <summary>Returns a random value between min and max (both included)</summary>
|
||||
/// <summary>Get a random value between min and max (both included)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetRandomValue(int min, int max);
|
||||
|
||||
@ -478,6 +498,10 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool SaveFileData(sbyte* fileName, void* data, uint bytesToWrite);
|
||||
|
||||
/// <summary>Export data to code (.h), returns true on success</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool ExportDataAsCode(sbyte* data, uint size, sbyte* fileName);
|
||||
|
||||
// Load text data from file (read), returns a '\0' terminated string
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern char* LoadFileText(sbyte* fileName);
|
||||
@ -502,6 +526,10 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool IsFileExtension(sbyte* fileName, sbyte* ext);
|
||||
|
||||
/// <summary> Get file length in bytes</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetFileLength(sbyte* fileName);
|
||||
|
||||
/// <summary>Get pointer to extension for a filename string (includes dot: '.png')</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern sbyte* GetFileExtension(sbyte* fileName);
|
||||
@ -526,13 +554,21 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern sbyte* GetWorkingDirectory();
|
||||
|
||||
/// <summary>Get the directory of the running application (uses static string)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern sbyte* GetApplicationDirectory();
|
||||
|
||||
/// <summary>Get filenames in a directory path (memory should be freed)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern char** GetDirectoryFiles(sbyte* dirPath, int* count);
|
||||
public static extern FilePathList LoadDirectoryFiles(sbyte* dirPath, int* count);
|
||||
|
||||
/// <summary>Clear directory files paths buffers (free memory)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ClearDirectoryFiles();
|
||||
public static extern void UnloadDirectoryFiles(FilePathList files);
|
||||
|
||||
/// <summary>Check if a given path is a file or a directory</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool IsPathFile(sbyte* path);
|
||||
|
||||
/// <summary>Change working directory, return true on success</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
@ -544,11 +580,11 @@ namespace Raylib_cs
|
||||
|
||||
/// <summary>Get dropped files names (memory should be freed)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern sbyte** GetDroppedFiles(int* count);
|
||||
public static extern FilePathList LoadDroppedFiles();
|
||||
|
||||
/// <summary>Clear dropped files paths buffer (free memory)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ClearDroppedFiles();
|
||||
public static extern void UnloadDroppedFiles(FilePathList files);
|
||||
|
||||
/// <summary>Get file modification time (last write time)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
@ -573,17 +609,6 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern byte* DecodeDataBase64(byte* data, int* outputLength);
|
||||
|
||||
|
||||
// Persistent storage management
|
||||
|
||||
/// <summary>Save integer value to storage file (to defined position)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool SaveStorageValue(uint position, int value);
|
||||
|
||||
/// <summary>Load integer value from storage file (from defined position)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int LoadStorageValue(uint position);
|
||||
|
||||
/// <summary>Open URL with default system browser (if available)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void OpenURL(sbyte* url);
|
||||
@ -629,7 +654,7 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool IsGamepadAvailable(int gamepad);
|
||||
|
||||
/// <summary>Return gamepad internal name id</summary>
|
||||
/// <summary>Get gamepad internal name id</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern sbyte* GetGamepadName(int gamepad);
|
||||
|
||||
@ -653,11 +678,11 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetGamepadButtonPressed();
|
||||
|
||||
/// <summary>Return gamepad axis count for a gamepad</summary>
|
||||
/// <summary>Get gamepad axis count for a gamepad</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetGamepadAxisCount(int gamepad);
|
||||
|
||||
/// <summary>Return axis movement value for a gamepad axis</summary>
|
||||
/// <summary>Get axis movement value for a gamepad axis</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetGamepadAxisMovement(int gamepad, GamepadAxis axis);
|
||||
|
||||
@ -684,15 +709,15 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool IsMouseButtonUp(MouseButton button);
|
||||
|
||||
/// <summary>Returns mouse position X</summary>
|
||||
/// <summary>Get mouse position X</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMouseX();
|
||||
|
||||
/// <summary>Returns mouse position Y</summary>
|
||||
/// <summary>Get mouse position Y</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMouseY();
|
||||
|
||||
/// <summary>Returns mouse position XY</summary>
|
||||
/// <summary>Get mouse position XY</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetMousePosition();
|
||||
|
||||
@ -712,10 +737,14 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMouseScale(float scaleX, float scaleY);
|
||||
|
||||
/// <summary>Returns mouse wheel movement Y</summary>
|
||||
/// <summary>Get mouse wheel movement for X or Y, whichever is larger</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetMouseWheelMove();
|
||||
|
||||
/// <summary>Get mouse wheel movement for both X and Y</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetMouseWheelMoveV();
|
||||
|
||||
/// <summary>Set mouse cursor</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMouseCursor(MouseCursor cursor);
|
||||
@ -723,15 +752,15 @@ namespace Raylib_cs
|
||||
|
||||
// Input-related functions: touch
|
||||
|
||||
/// <summary>Returns touch position X for touch point 0 (relative to screen size)</summary>
|
||||
/// <summary>Get touch position X for touch point 0 (relative to screen size)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetTouchX();
|
||||
|
||||
/// <summary>Returns touch position Y for touch point 0 (relative to screen size)</summary>
|
||||
/// <summary>Get touch position Y for touch point 0 (relative to screen size)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetTouchY();
|
||||
|
||||
/// <summary>Returns touch position XY for a touch point index (relative to screen size)</summary>
|
||||
/// <summary>Get touch position XY for a touch point index (relative to screen size)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetTouchPosition(int index);
|
||||
|
||||
@ -816,9 +845,11 @@ namespace Raylib_cs
|
||||
// Basic Shapes Drawing Functions (Module: shapes)
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
/// <summary>Set texture and rectangle to be used on shapes drawing<br/>
|
||||
/// <summary>
|
||||
/// Set texture and rectangle to be used on shapes drawing<br/>
|
||||
/// NOTE: It can be useful when using basic shapes and one single font.<br/>
|
||||
/// Defining a white rectangle would allow drawing everything in a single draw call.</summary>
|
||||
/// Defining a white rectangle would allow drawing everything in a single draw call.
|
||||
/// </summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetShapesTexture(Texture2D texture, Rectangle source);
|
||||
|
||||
@ -1082,7 +1113,7 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageWhiteNoise(int width, int height, float factor);
|
||||
|
||||
/// <summary>Generate image: cellular algorithm. Bigger tileSize means bigger cells</summary>
|
||||
/// <summary>Generate image: cellular algorithm, bigger tileSize means bigger cells</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageCellular(int width, int height, int tileSize);
|
||||
|
||||
@ -1429,7 +1460,10 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFont(sbyte* fileName);
|
||||
|
||||
/// <summary>Load font from file with extended parameters</summary>
|
||||
/// <summary>
|
||||
/// Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load
|
||||
/// the default character set
|
||||
/// </summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFontEx(sbyte* fileName, int fontSize, int* fontChars, int glyphCount);
|
||||
|
||||
@ -1437,8 +1471,7 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFontFromImage(Image image, Color key, int firstChar);
|
||||
|
||||
/// <summary>Load font from memory buffer, fileType refers to extension: i.e. "ttf"<br/>
|
||||
/// fileData refers to const unsigned char *</summary>
|
||||
/// <summary>Load font from memory buffer, fileType refers to extension: i.e. "ttf"</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFontFromMemory(sbyte* fileType, byte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount);
|
||||
|
||||
@ -1458,6 +1491,10 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadFont(Font font);
|
||||
|
||||
/// <summary>Export font as code file, returns true on success</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool ExportFontAsCode(Font font, sbyte* fileName);
|
||||
|
||||
|
||||
// Text drawing functions
|
||||
|
||||
@ -1479,8 +1516,11 @@ namespace Raylib_cs
|
||||
|
||||
/// <summary>Draw one character (codepoint)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float scale, Color tint);
|
||||
public static extern void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint);
|
||||
|
||||
/// <summary>Draw multiple characters (codepoint)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextCodepoints(Font font, int* codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint);
|
||||
|
||||
// Text font info functions
|
||||
|
||||
@ -1519,7 +1559,7 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetCodepointCount(sbyte* text);
|
||||
|
||||
/// <summary>Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure</summary>
|
||||
/// <summary>Get next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetCodepoint(sbyte* text, int* bytesProcessed);
|
||||
|
||||
@ -1747,11 +1787,6 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void GenMeshTangents(Mesh* mesh);
|
||||
|
||||
/// <summary>Compute mesh binormals</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void GenMeshBinormals(Mesh* mesh);
|
||||
|
||||
|
||||
// Material loading/unloading functions
|
||||
|
||||
//TODO: safe Helper method
|
||||
@ -1850,7 +1885,7 @@ namespace Raylib_cs
|
||||
|
||||
/// <summary>Draw a billboard texture defined by source</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawBillboardRec(Camera3D camera, Texture2D texture, Rectangle source, Vector3 center, float size, Color tint);
|
||||
public static extern void DrawBillboardRec(Camera3D camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint);
|
||||
|
||||
/// <summary>Draw a billboard texture defined by source and rotation</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
@ -1894,16 +1929,12 @@ namespace Raylib_cs
|
||||
|
||||
/// <summary>Detect collision between ray and sphere</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern CBool GetRayCollisionSphere(Ray ray, Vector3 center, float radius);
|
||||
public static extern RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius);
|
||||
|
||||
/// <summary>Detect collision between ray and box</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern RayCollision GetRayCollisionBox(Ray ray, BoundingBox box);
|
||||
|
||||
/// <summary>Get collision info between ray and model</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern RayCollision GetRayCollisionModel(Ray ray, Model model);
|
||||
|
||||
/// <summary>Get collision info between ray and mesh</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix4x4 transform);
|
||||
@ -1946,8 +1977,7 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Wave LoadWave(sbyte* fileName);
|
||||
|
||||
/// <summary>Load wave from memory buffer, fileType refers to extension: i.e. "wav"<br/>
|
||||
/// fileData refers to a const unsigned char *</summary>
|
||||
/// <summary>Load wave from memory buffer, fileType refers to extension: i.e. "wav"</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Wave LoadWaveFromMemory(sbyte* fileType, byte* fileData, int dataSize);
|
||||
|
||||
@ -2022,9 +2052,9 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetSoundPitch(Sound sound, float pitch);
|
||||
|
||||
/// <summary>Convert wave data to desired format</summary>
|
||||
/// <summary>Set pan for a sound (0.5 is center)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void WaveFormat(Wave* wave, int sampleRate, int sampleSize, int channels);
|
||||
public static extern void SetSoundPan(Sound sound, float pan);
|
||||
|
||||
/// <summary>Copy a wave to a new wave</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
@ -2034,12 +2064,14 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void WaveCrop(Wave* wave, int initSample, int finalSample);
|
||||
|
||||
//TODO: Span
|
||||
/// <summary>Convert wave data to desired format</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void WaveFormat(Wave* wave, int sampleRate, int sampleSize, int channels);
|
||||
|
||||
/// <summary>Get samples data from wave as a floats array</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float* LoadWaveSamples(Wave wave);
|
||||
|
||||
//TODO: Span
|
||||
/// <summary>Unload samples data loaded with LoadWaveSamples()</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadWaveSamples(float* samples);
|
||||
@ -2095,6 +2127,10 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMusicPitch(Music music, float pitch);
|
||||
|
||||
/// <summary>Set pan for a music (0.5 is center)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMusicPan(Music music, float pan);
|
||||
|
||||
/// <summary>Get music time length (in seconds)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetMusicTimeLength(Music music);
|
||||
@ -2150,8 +2186,24 @@ namespace Raylib_cs
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetAudioStreamPitch(AudioStream stream, float pitch);
|
||||
|
||||
/// <summary>Set pan for audio stream (0.5 is centered)</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetAudioStreamPan(AudioStream stream, float pan);
|
||||
|
||||
/// <summary>Default size for new audio streams</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetAudioStreamBufferSizeDefault(int size);
|
||||
|
||||
/// <summary>Audio thread callback to request new data</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetAudioStreamCallback(AudioStream stream, delegate* unmanaged[Cdecl]<sbyte*, uint, void> callback);
|
||||
|
||||
/// <summary>Attach audio stream processor to stream</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void AttachAudioStreamProcessor(AudioStream stream, delegate* unmanaged[Cdecl]<sbyte*, uint, void> processor);
|
||||
|
||||
/// <summary>Detach audio stream processor from stream</summary>
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DetachAudioStreamProcessor(AudioStream stream, delegate* unmanaged[Cdecl]<sbyte*, uint, void> processor);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user