diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..d48f687 Binary files /dev/null and b/icon.png differ diff --git a/source/core.adb b/source/core.adb index 6f22494..f9ceed7 100644 --- a/source/core.adb +++ b/source/core.adb @@ -33,6 +33,8 @@ package body core is sound_array : access sound_data_array; font_array : access font_data_array; + game_icon : ray.image; + ------------------------------------------------------------------------------------------ procedure terminal (colour : in terminal_colour := white; @@ -367,11 +369,15 @@ package body core is echo (comment, "-- -- Window title : Xorana"); echo (comment, "-- -- Window width : 1800"); echo (comment, "-- -- Window height : 900"); - ray.open_window (1800, 900, "Xorana"); + ray.open_window (1800, 900, c_string ("Xorana")); -- echo (comment, "-- Initializing Raylib audio device data..."); ray.open_audio_device; -- + game_icon := ray.load_image (c_string ("./icon.png")); + -- + ray.window_icon (game_icon); + -- ray.randomization (19970725); ray.set_target_fps (60); -- @@ -397,6 +403,8 @@ package body core is echo (comment, "-- Deinitializing Raylib audio device data..."); ray.close_audio_device; -- + ray.unload_image (game_icon); + -- echo (comment, "-- Deinitializing Raylib window data..."); ray.close_window; -- diff --git a/source/ray.ads b/source/ray.ads index 91d2239..cd50087 100644 --- a/source/ray.ads +++ b/source/ray.ads @@ -118,10 +118,12 @@ package ray is function load_texture (file_path : in string) return texture with import => true, convention => c, external_name => "LoadTexture"; function load_sound (file_path : in string) return sound with import => true, convention => c, external_name => "LoadSound"; function load_font (file_path : in string) return font with import => true, convention => c, external_name => "LoadFont"; + function load_image (file_path : in string) return image with import => true, convention => c, external_name => "LoadImage"; procedure unload_texture (data : in texture) with import => true, convention => c, external_name => "UnloadTexture"; procedure unload_sound (data : in sound) with import => true, convention => c, external_name => "UnloadSound"; procedure unload_font (data : in font) with import => true, convention => c, external_name => "UnloadFont"; + procedure unload_image (data : in image) with import => true, convention => c, external_name => "UnloadImage"; function image_colour (width, height : in integer; tint : in colour) return image with import => true, convention => c, external_name => "GenImageColor"; function image_import (data : in texture) return image with import => true, convention => c, external_name => "LoadImageFromTexture"; @@ -163,8 +165,10 @@ package ray is procedure pause_sound (data : in sound) with import => true, convention => c, external_name => "PauseSound"; procedure resume_sound (data : in sound) with import => true, convention => c, external_name => "ResumeSound"; - --~void ToggleFullscreen(void); - --~void SetWindowIcon(Image image); + procedure toggle_fullscreen with import => true, convention => c, external_name => "ToggleFullscreen"; + + procedure window_icon (icon : in image) with import => true, convention => c, external_name => "SetWindowIcon"; + --~void SetWindowMinSize(int width, int height); --~void SetWindowMaxSize(int width, int height); --~void SetWindowSize(int width, int height);