27 lines
996 B
Ada
27 lines
996 B
Ada
with Ada.Text_IO, Ada.Integer_Text_IO;
|
||
use Ada.Text_IO, Ada.Integer_Text_IO;
|
||
with Interfaces.C;
|
||
with Video.Backends.SDL.Windows;
|
||
with Video.Backends.SDL.Surfaces;
|
||
with Video.Backends.SDL.Message_Boxes;
|
||
use Video.Backends.SDL;
|
||
|
||
procedure Hello_World_SDL is
|
||
Screen_Width : constant := 640;
|
||
Screen_Height : constant := 480;
|
||
Wnd : Windows.Window_Access;
|
||
Surf : Surfaces.Surface_Access;
|
||
Err : Error_Code;
|
||
begin
|
||
Wnd := Windows.Create_Window ("Hello World",
|
||
Width => Screen_Width, Height => Screen_Height);
|
||
Surf := Windows.Get_Window_Surface (Wnd);
|
||
|
||
Put (Integer (Surf.w)); Put (" × "); Put (Integer (Surf.h)); New_Line;
|
||
Put ("Pitch: "); Put (Integer (Surf.pitch)); New_Line;
|
||
Put ("Bits per pixel: "); Put (Integer (Surf.format.Bits_Per_Pixel)); New_Line;
|
||
Put ("Bytes per pixel: "); Put (Integer (Surf.format.Bytes_Per_Pixel)); New_Line;
|
||
|
||
Err := Message_Boxes.Show_Message_Box (Title => "Hello World", Message => "Greetz!");
|
||
end Hello_World_SDL;
|