Bläddra i källkod

More font functions and C_String function...

master
Ognjen Milan Robovic 1 månad sedan
förälder
incheckning
345ff1de07
2 ändrade filer med 78 tillägg och 35 borttagningar
  1. +70
    -32
      raylib.ads
  2. +8
    -3
      window.adb

+ 70
- 32
raylib.ads Visa fil

@@ -3065,40 +3065,75 @@ package Raylib is
Convention => C,
External_Name => "LoadFont";

--~function Font LoadFontEx (const char *fileName, int fontSize, int *codepoints, int codepointCount) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
function Load_Font_Ex (
File_Name : String := "";
Font_Size : Integer := 32;
Code_Points : access Integer := null;
Code_Point_Count : Natural := 0
) return Font with
Import => True,
Convention => C,
External_Name => "LoadFontEx";

--~function Font LoadFontFromImage (Image image, Color key, int firstChar) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
function Load_Font_From_Image (
Data : Image := No_Image;
Key : Color := White;
First_Character : Integer := 0
) return Font with
Import => True,
Convention => C,
External_Name => "LoadFontFromImage";

--~function Font LoadFontFromMemory (const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
function Load_Font_From_Memory (
File_Type : String := "";
File_Data : Pointer := null;
Data_Size : Natural := 0;
Font_Size : Integer := 32;
Code_Points : access Integer := null;
Code_Point_Count : Natural := 0
) return Font with
Import => True,
Convention => C,
External_Name => "LoadFontFromMemory";

--~function bool IsFontReady (Font font) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
function Is_Font_Ready (
Data : Font := No_Font
) return Logical with
Import => True,
Convention => C,
External_Name => "IsFontReady";

--~function GlyphInfo *LoadFontData (const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
function Load_Font_Data (
File_Data : Pointer := null;
Data_Size : Natural := 0;
Font_Size : Integer := 32;
Code_Points : access Integer := null;
Code_Point_Count : Natural := 0;
Kind : Integer := 0
) return access Glyph_Info with
Import => True,
Convention => C,
External_Name => "LoadFontData";

--~function Image GenImageFontAtlas (const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
function Gen_Image_Font_Atlas (
Glyphs : access Glyph_Info := null;
Glyph_Rectangles : access Rectangle := null;
Glyph_Count : Integer := 0;
Font_Size : Integer := 32;
Padding : Integer := 0;
Pack_Method : Integer := 0
) return Image with
Import => True,
Convention => C,
External_Name => "GenImageFontAtlas";

--~procedure UnloadFontData (GlyphInfo *glyphs, int glyphCount) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
procedure Unload_Font_Data (
Glyphs : access Glyph_Info := null;
Glyph_Count : Integer := 0
) with
Import => True,
Convention => C,
External_Name => "UnloadFontData";

procedure Unload_Font (
Data : Font := No_Font
@@ -3107,10 +3142,13 @@ package Raylib is
Convention => C,
External_Name => "UnloadFont";

--~function bool ExportFontAsCode (Font font, const char *fileName) with
--~Import => True,
--~Convention => C,
--~External_Name => "";
function Export_Font_As_Code (
Data : Font := No_Font;
File_Name : String := ""
) return Logical with
Import => True,
Convention => C,
External_Name => "ExportFontAsCode";

procedure Draw_FPS (
X : Integer := 0;


+ 8
- 3
window.adb Visa fil

@@ -3,7 +3,12 @@ use Raylib;

procedure Window is

Text : String := "Heyo world!" & Character'Val (0);
function C_String (Data : String) return String is
begin
return (Data & Character'Val (0));
end C_String;

Text : String := C_String ("Heyo world!");

Dragdown : Texture;

@@ -12,12 +17,12 @@ procedure Window is

begin

Open_Window (720, 360, "Heyo Raylib!" & Character'Val (0));
Open_Window (720, 360, C_String ("Heyo Raylib!"));

Set_Exit_Key (Key_Q); -- Default is Key_Escape
Set_Target_FPS (72); -- Default is 60

Dragdown := Load_Texture ("./texture.png" & Character'Val (0));
Dragdown := Load_Texture (C_String ("./texture.png"));

Main_Loop: loop
exit when Window_Should_Close;


Laddar…
Avbryt
Spara