From 027dd77c9211a52d413b6ea26974a0ca4edcd1ef Mon Sep 17 00:00:00 2001 From: xolatile Date: Fri, 5 Apr 2024 07:15:54 -0400 Subject: [PATCH] Shape functions and few utility functions... --- raylib.ads | 251 ++++++++++++++++++++++++++++++++++++++++++------------------- window.adb | 2 +- 2 files changed, 176 insertions(+), 77 deletions(-) diff --git a/raylib.ads b/raylib.ads index 5def8ce..54d3188 100644 --- a/raylib.ads +++ b/raylib.ads @@ -2093,25 +2093,40 @@ package Raylib is Convention => C, External_Name => "UpdateCamera"; - --~procedure UpdateCameraPro (Camera *camera, Vector3 movement, Vector3 rotation, float zoom) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Update_Camera_Pro ( + Data : access Camera_3D := null; + Movement : Vector_3D := (0.0, 0.0, 0.0); + Rotation : Vector_3D := (0.0, 0.0, 0.0); + Zoom : Float := 0.0 + ) with + Import => True, + Convention => C, + External_Name => "UpdateCameraPro"; - --~procedure SetShapesTexture (Texture2D texture, Rectangle source) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Set_Shapes_Texture ( + Data : Texture := No_Texture; + Source : Rectangle := No_Rectangle + ) with + Import => True, + Convention => C, + External_Name => "SetShapesTexture"; - --~procedure DrawPixel (int posX, int posY, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Pixel ( + X : Integer := 0; + Y : Integer := 0; + Tint : Color := White + ) with + Import => True, + Convention => C, + External_Name => "DrawPixel"; - --~procedure DrawPixelV (Vector2 position, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Pixel_V ( + Position : Vector_2D := (0.0, 0.0); + Tint : Color := White + ) with + Import => True, + Convention => C, + External_Name => "DrawPixelV"; procedure Draw_Line ( X0 : Integer := 0; @@ -2124,80 +2139,164 @@ package Raylib is Convention => C, External_Name => "DrawLine"; - --~procedure DrawLineV (Vector2 startPos, Vector2 endPos, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Line_V ( + From : Vector_2D := (0.0, 0.0); + To : Vector_2D := (0.0, 0.0); + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawLineV"; - --~procedure DrawLineEx (Vector2 startPos, Vector2 endPos, float thick, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Line_Ex ( + From : Vector_2D := (0.0, 0.0); + To : Vector_2D := (0.0, 0.0); + Thick : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawLineEx"; - --~procedure DrawLineStrip (Vector2 *points, int pointCount, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Line_Strip ( + Points : access Vector_2D := null; + Point_Count : Natural := 0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawLineStrip"; - --~procedure DrawLineBezier (Vector2 startPos, Vector2 endPos, float thick, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Line_Bezier ( + From : Vector_2D := (0.0, 0.0); + To : Vector_2D := (0.0, 0.0); + Thick : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawLineBezier"; - --~procedure DrawCircle (int centerX, int centerY, float radius, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Circle ( + X : Integer := 0; + Y : Integer := 0; + Radius : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawCircle"; - --~procedure DrawCircleSector (Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Circle_Sector ( + Center : Vector_2D := (0.0, 0.0); + Radius : Float := 0.0; + From : Float := 0.0; + To : Float := 0.0; + Segments : Integer := 0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawCircleSector"; - --~procedure DrawCircleSectorLines (Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Circle_Sector_Lines ( + Center : Vector_2D := (0.0, 0.0); + Radius : Float := 0.0; + From : Float := 0.0; + To : Float := 0.0; + Segments : Integer := 0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawCircleSectorLines"; - --~procedure DrawCircleGradient (int centerX, int centerY, float radius, Color color1, Color color2) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Circle_Gradient ( + X : Integer := 0; + Y : Integer := 0; + Radius : Float := 0.0; + Tint_1 : Color := Black; + Tint_2 : Color := White + ) with + Import => True, + Convention => C, + External_Name => "DrawCircleGradient"; - --~procedure DrawCircleV (Vector2 center, float radius, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Circle_V ( + Center : Vector_2D := (0.0, 0.0); + Radius : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawCircleV"; - --~procedure DrawCircleLines (int centerX, int centerY, float radius, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Circle_Lines ( + X : Integer := 0; + Y : Integer := 0; + Radius : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawCircleLines"; - --~procedure DrawCircleLinesV (Vector2 center, float radius, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Circle_Lines_V ( + Center : Vector_2D := (0.0, 0.0); + Radius : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawCircleLinesV"; - --~procedure DrawEllipse (int centerX, int centerY, float radiusH, float radiusV, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Ellipse ( + X : Integer := 0; + Y : Integer := 0; + Horizontal : Float := 0.0; + Vertical : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawEllipse"; - --~procedure DrawEllipseLines (int centerX, int centerY, float radiusH, float radiusV, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Ellipse_Lines ( + X : Integer := 0; + Y : Integer := 0; + Horizontal : Float := 0.0; + Vertical : Float := 0.0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawEllipseLines"; - --~procedure DrawRing (Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Ring ( + Center : Vector_2D := (0.0, 0.0); + Inner_Radius : Float := 0.0; + Outer_Radius : Float := 0.0; + From : Float := 0.0; + To : Float := 0.0; + Segments : Integer := 0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawRing"; - --~procedure DrawRingLines (Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Draw_Ring_Lines ( + Center : Vector_2D := (0.0, 0.0); + Inner_Radius : Float := 0.0; + Outer_Radius : Float := 0.0; + From : Float := 0.0; + To : Float := 0.0; + Segments : Integer := 0; + Tint : Color := Black + ) with + Import => True, + Convention => C, + External_Name => "DrawRingLines"; procedure Draw_Rectangle ( X : Integer := 0; diff --git a/window.adb b/window.adb index 0afc910..a0897cb 100644 --- a/window.adb +++ b/window.adb @@ -31,7 +31,7 @@ begin -- 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_Text (Text, 90, 90); Draw_FPS (X, Y); Draw_Line (0, 0, 300, 300, Black); Draw_Rectangle (120, 120, 30, 60, Blue);