From ee8307f855a9adc6ce4fbdcb1ab9f2551b01017f Mon Sep 17 00:00:00 2001 From: xolatile Date: Fri, 5 Apr 2024 07:45:25 -0400 Subject: [PATCH] Added a lot of mesh and model functions... --- raylib.ads | 346 +++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 222 insertions(+), 124 deletions(-) diff --git a/raylib.ads b/raylib.ads index 54d3188..7e9a24a 100644 --- a/raylib.ads +++ b/raylib.ads @@ -718,6 +718,8 @@ package Raylib is Parent : Integer := 0; end record with Convention => C_Pass_By_Copy; + No_Bone_Info : Bone_Info; + type Material_Array_4 is array (0 .. 3) of Material; type Material_Array is array (Natural range <>) of Material; @@ -743,6 +745,8 @@ package Raylib is Name : Character_Array_32 := Empty; end record with Convention => C_Pass_By_Copy; + No_Model_Animation : Model_Animation; + type Ray is record Position : Vector_3D := (0.0, 0.0, 0.0); Direction : Vector_3D := (0.0, 0.0, 0.0); @@ -3770,105 +3774,171 @@ package Raylib is Convention => C, External_Name => "GenMeshPlane"; - --~function Mesh GenMeshCube (float width, float height, float length) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Cube ( + Width : Float := 0.0; + Height : Float := 0.0; + Length : Float := 0.0 + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshCube"; - --~function Mesh GenMeshSphere (float radius, int rings, int slices) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Sphere ( + Radius : Float := 0.0; + Rings : Integer := 0; + Slices : Integer := 0 + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshSphere"; - --~function Mesh GenMeshHemiSphere (float radius, int rings, int slices) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Hemisphere ( + Radius : Float := 0.0; + Rings : Integer := 0; + Slices : Integer := 0 + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshHemiSphere"; - --~function Mesh GenMeshCylinder (float radius, float height, int slices) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Cylinder ( + Radius : Float := 0.0; + Height : Float := 0.0; + Slices : Integer := 0 + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshCylinder"; - --~function Mesh GenMeshCone (float radius, float height, int slices) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Cone ( + Radius : Float := 0.0; + Height : Float := 0.0; + Slices : Integer := 0 + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshCone"; - --~function Mesh GenMeshTorus (float radius, float size, int radSeg, int sides) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Torus ( + Radius : Float := 0.0; + Size : Float := 0.0; + Segments : Integer := 0; + Sides : Integer := 0 + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshTorus"; - --~function Mesh GenMeshKnot (float radius, float size, int radSeg, int sides) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Knot ( + Radius : Float := 0.0; + Size : Float := 0.0; + Segments : Integer := 0; + Sides : Integer := 0 + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshKnot"; - --~function Mesh GenMeshHeightmap (Image heightmap, Vector3 size) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Height_Map ( + Height_Map : Image := No_Image; + Size : Vector_3D := (0.0, 0.0, 0.0) + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshHeightmap"; - --~function Mesh GenMeshCubicmap (Image cubicmap, Vector3 cubeSize) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Gen_Mesh_Cubic_Map ( + Cubic_Map : Image := No_Image; + Size : Vector_3D := (0.0, 0.0, 0.0) + ) return Mesh with + Import => True, + Convention => C, + External_Name => "GenMeshCubicmap"; - --~function Material *LoadMaterials (const char *fileName, int *materialCount) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Load_Materials ( + File_Name : String := ""; + Counts : access Integer := null + ) return access Material with + Import => True, + Convention => C, + External_Name => "LoadMaterials"; - --~function Material LoadMaterialDefault (void) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Load_Material_Default return Material with + Import => True, + Convention => C, + External_Name => "LoadMaterialDefault"; - --~function bool IsMaterialReady (Material material) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Is_Material_Ready ( + Data : Material := No_Material + ) return Logical with + Import => True, + Convention => C, + External_Name => "IsMaterialReady"; - --~procedure UnloadMaterial (Material material) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Unload_Material ( + Data : Material := No_Material + ) with + Import => True, + Convention => C, + External_Name => "UnloadMaterial"; - --~procedure SetMaterialTexture (Material *material, int mapType, Texture2D texture) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Set_Material_Texture ( + Data : access Material := null; + Kind : Material_Map_Index := Material_Map_Height; + This : Texture := No_Texture + ) with + Import => True, + Convention => C, + External_Name => "SetMaterialTexture"; - --~procedure SetModelMeshMaterial (Model *model, int meshId, int materialId) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Set_Model_Mesh_Material ( + Data : access Model := null; + Mesh_Id : Integer := 0; + Material_Id : Integer := 0 + ) with + Import => True, + Convention => C, + External_Name => "SetModelMeshMaterial"; - --~function ModelAnimation *LoadModelAnimations (const char *fileName, int *animCount) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Load_Model_Animations ( + File_Name : String := ""; + Counts : access Integer := null + ) return access Model_Animation with + Import => True, + Convention => C, + External_Name => "LoadModelAnimations"; - --~procedure UpdateModelAnimation (Model model, ModelAnimation anim, int frame) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Update_Model_Animation ( + Data : Model := No_Model; + Animation : Model_Animation := No_Model_Animation; + Frame : Integer := 0 + ) with + Import => True, + Convention => C, + External_Name => "UpdateModelAnimation"; - --~procedure UnloadModelAnimation (ModelAnimation anim) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Unload_Model_Animation ( + Animation : Model_Animation := No_Model_Animation + ) with + Import => True, + Convention => C, + External_Name => "UnloadModelAnimation"; - --~procedure UnloadModelAnimations (ModelAnimation *animations, int animCount) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Unload_Model_Animations ( + Animations : access Model_Animation := null; + Animation_Count : Natural := 0 + ) with + Import => True, + Convention => C, + External_Name => "UnloadModelAnimations"; - --~function bool IsModelAnimationValid (Model model, ModelAnimation anim) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Is_Model_Animation_Valid ( + Data : Model := No_Model; + Animation : Model_Animation := No_Model_Animation + ) return Logical with + Import => True, + Convention => C, + External_Name => "IsModelAnimationValid"; function Check_Collision_Spheres ( Center_1 : Vector_3D := (0.0, 0.0, 0.0); @@ -3974,20 +4044,28 @@ package Raylib is Convention => C, External_Name => "GetMasterVolume"; - --~function Wave LoadWave (const char *fileName) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Load_Wave ( + File_Name : String := "" + ) return Wave with + Import => True, + Convention => C, + External_Name => "LoadWave"; - --~function Wave LoadWaveFromMemory (const char *fileType, const unsigned char *fileData, int dataSize) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Load_Wave_From_Memory ( + File_Type : String := ""; + File_Data : Pointer := null; + Data_Size : Natural := 0 + ) return Wave with + Import => True, + Convention => C, + External_Name => "LoadWaveFromMemory"; - --~function bool IsWaveReady (Wave wave) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Is_Wave_Ready ( + Data : Wave := No_Wave + ) return Logical with + Import => True, + Convention => C, + External_Name => "IsWaveReady"; function Load_Sound ( File_Name : String := "" @@ -3996,30 +4074,42 @@ package Raylib is Convention => C, External_Name => "LoadSound"; - --~function Sound LoadSoundFromWave (Wave wave) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Load_Sound_From_Wave ( + Data : Wave := No_Wave + ) return Sound with + Import => True, + Convention => C, + External_Name => "LoadSoundFromWave"; - --~function Sound LoadSoundAlias (Sound source) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Load_Sound_Alias ( + Source : Sound := No_Sound + ) return Sound with + Import => True, + Convention => C, + External_Name => "LoadSoundAlias"; - --~function bool IsSoundReady (Sound sound) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Is_Sound_Ready ( + Source : Sound := No_Sound + ) return Logical with + Import => True, + Convention => C, + External_Name => "IsSoundReady"; - --~procedure UpdateSound (Sound sound, const void *data, int sampleCount) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Update_Sound ( + Source : Sound := No_Sound; + Data : Pointer := null; + Sample_Count : Integer := 0 + ) with + Import => True, + Convention => C, + External_Name => "UpdateSound"; - --~procedure UnloadWave (Wave wave) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Unload_Wave ( + Data : Wave := No_Wave + ) with + Import => True, + Convention => C, + External_Name => "UnloadWave"; procedure Unload_Sound ( Data : Sound := No_Sound @@ -4028,20 +4118,28 @@ package Raylib is Convention => C, External_Name => "UnloadSound"; - --~procedure UnloadSoundAlias (Sound alias) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + procedure Unload_Sound_Alias ( + Alias : Sound := No_Sound + ) with + Import => True, + Convention => C, + External_Name => "UnloadSoundAlias"; - --~function bool ExportWave (Wave wave, const char *fileName) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Export_Wave ( + Data : Wave := No_Wave; + File_Name : String := "" + ) return Logical with + Import => True, + Convention => C, + External_Name => "ExportWave"; - --~function bool ExportWaveAsCode (Wave wave, const char *fileName) with - --~Import => True, - --~Convention => C, - --~External_Name => ""; + function Export_Wave_As_Code ( + Data : Wave := No_Wave; + File_Name : String := "" + ) return Logical with + Import => True, + Convention => C, + External_Name => "ExportWaveAsCode"; procedure Play_Sound ( Data : Sound := No_Sound