]> git.xolatile.top Git - xolatile-raylib-ada.git/commitdiff
Added 6 more functions...
authorxolatile <xolatile@proton.me>
Mon, 18 Mar 2024 19:28:32 +0000 (15:28 -0400)
committerxolatile <xolatile@proton.me>
Mon, 18 Mar 2024 19:28:32 +0000 (15:28 -0400)
raylib.ads
window.adb

index e1a2e20625e64cc4f2fbfef49c86c69a8fee55b5..1016e766c4034cb4cd4314c55e70efd40af6e109 100644 (file)
@@ -627,18 +627,22 @@ package Raylib is
        type Quaternion is new Vector_4D;
 
        type Matrix_4D is record
-               --~M00, M10, M20, M30,
-               --~M01, M11, M21, M31,
-               --~M02, M12, M22, M32,
-               --~M03, M13, M23, M33 : Float := (
-               --~1.0, 0.0, 0.0, 0.0,
-               --~0.0, 1.0, 0.0, 0.0,
-               --~0.0, 0.0, 1.0, 0.0,
-               --~0.0, 0.0, 0.0, 1.0);
-               M00, M10, M20, M30,
-               M01, M11, M21, M31,
-               M02, M12, M22, M32,
-               M03, M13, M23, M33 : Float;
+               M00 : Float := 1.0;
+               M10 : Float := 0.0;
+               M20 : Float := 0.0;
+               M30 : Float := 0.0;
+               M01 : Float := 0.0;
+               M11 : Float := 1.0;
+               M21 : Float := 0.0;
+               M31 : Float := 0.0;
+               M02 : Float := 0.0;
+               M12 : Float := 0.0;
+               M22 : Float := 1.0;
+               M32 : Float := 0.0;
+               M03 : Float := 0.0;
+               M13 : Float := 0.0;
+               M23 : Float := 0.0;
+               M33 : Float := 1.0;
        end record with Convention => C_Pass_By_Copy;
 
        Id_Matrix : Matrix_4D;
@@ -725,6 +729,8 @@ package Raylib is
                Projection    : Camera_Projection := Camera_Perspective;
        end record with Convention => C_Pass_By_Copy;
 
+       No_Camera_3D : Camera_3D;
+
        type Camera_2D is record
                Offset   : Vector_2D := (0.0, 0.0);
                Target   : Vector_2D := (0.0, 0.0);
@@ -732,6 +738,8 @@ package Raylib is
                Zoom     : Float     := 0.0;
        end record with Convention => C_Pass_By_Copy;
 
+       No_Camera_2D : Camera_2D;
+
        type Mesh is record
                Vertex_Count          :        Integer     := 0;
                Triangle_Count        :        Integer     := 0;
@@ -1475,44 +1483,65 @@ package Raylib is
                Import        => True,
                Convention    => C,
                External_Name => "UnloadShader";
---~################################################################
---~################################################################
---~################################################################
-       --~function Ray GetMouseRay (Vector2 mousePosition, Camera camera) with
-               --~Import        => True,
-               --~Convention    => C,
-               --~External_Name => "";
 
-       --~function Matrix GetCameraMatrix (Camera camera) with
-               --~Import        => True,
-               --~Convention    => C,
-               --~External_Name => "";
+       function Get_Mouse_Ray (
+               Mouse_Position : Vector_2D := (0.0, 0.0);
+               Camera         : Camera_3D := No_Camera_3D
+       ) return Ray with
+               Import        => True,
+               Convention    => C,
+               External_Name => "GetMouseRay";
 
-       --~function Matrix GetCameraMatrix2D (Camera2D camera) with
-               --~Import        => True,
-               --~Convention    => C,
-               --~External_Name => "";
+       function Get_Camera_Matrix_3D (
+               Camera : Camera_3D := No_Camera_3D
+       ) return Matrix_4D with
+               Import        => True,
+               Convention    => C,
+               External_Name => "GetCameraMatrix";
 
-       --~function Vector2 GetWorldToScreen (Vector3 position, Camera camera) with
-               --~Import        => True,
-               --~Convention    => C,
-               --~External_Name => "";
+       function Get_Camera_Matrix_2D (
+               Camera : Camera_2D := No_Camera_2D
+       ) return Matrix_4D with
+               Import        => True,
+               Convention    => C,
+               External_Name => "GetCameraMatrix2D";
 
-       --~function Vector2 GetScreenToWorld2D (Vector2 position, Camera2D camera) with
-               --~Import        => True,
-               --~Convention    => C,
-               --~External_Name => "";
+       function Get_World_To_Screen_3D (
+               Position : Vector_3D := (0.0, 0.0, 0.0);
+               Camera   : Camera_3D := No_Camera_3D
+       ) return Vector_2D with
+               Import        => True,
+               Convention    => C,
+               External_Name => "GetWorldToScreen";
 
-       --~function Vector2 GetWorldToScreenEx (Vector3 position, Camera camera, int width, int height) with
-               --~Import        => True,
-               --~Convention    => C,
-               --~External_Name => "";
+       function Get_Screen_To_World_2D (
+               Position : Vector_2D := (0.0, 0.0);
+               Camera   : Camera_2D := No_Camera_2D
+       ) return Vector_2D with
+               Import        => True,
+               Convention    => C,
+               External_Name => "GetScreenToWorld2D";
 
-       --~function Vector2 GetWorldToScreen2D (Vector2 position, Camera2D camera) with
-               --~Import        => True,
-               --~Convention    => C,
-               --~External_Name => "";
+       function Get_World_To_Screen_Ex (
+               Position : Vector_3D := (0.0, 0.0, 0.0);
+               Camera   : Camera_3D := No_Camera_3D;
+               Width    : Integer   := 0;
+               Height   : Integer   := 0
+       ) return Vector_2D with
+               Import        => True,
+               Convention    => C,
+               External_Name => "GetWorldToScreenEx";
 
+       function Get_World_To_Screen_2D (
+               Position : Vector_2D := (0.0, 0.0);
+               Camera   : Camera_2D := No_Camera_2D
+       ) return Vector_2D with
+               Import        => True,
+               Convention    => C,
+               External_Name => "GetWorldToScreen2D";
+################################################################
+################################################################
+################################################################
        procedure Set_Target_FPS (
                FPS : Integer := 60
        ) with
index 55035f41c7eac6f9772bef238bc7194a59b7f051..f6b80862cb855aa054e2efcbbb712d886bfe2e64 100644 (file)
@@ -25,10 +25,9 @@ begin
                Begin_Drawing;
                --
                Clear_Background (Sky_Blue);
-               --
                Draw_Texture     (Dragdown, 100, 100, White);
                Draw_Text_Pro    (Get_Font_Default, Text, (90.0, 90.0), (9.0, 9.0), 0.0, 32.0, 4.0, Red);
-               Draw_FPS         (60, 60);
+               Draw_FPS         (X, Y);
                Draw_Line        (0, 0, 300, 300, Black);
                Draw_Rectangle   (120, 120, 30, 60, Blue);
                --