From: "Björn Lundin" <b.f.lundin@gmail.com>
Subject: Text in sdlada
Date: Tue, 01 Dec 2015 23:27:25 +0100
Date: 2015-12-01T23:27:25+01:00 [thread overview]
Message-ID: <n3l6ns$o2f$1@dont-email.me> (raw)
Hi!
I'm playing with sdlada 2.1.1 and I am looking for a way to write text
on my window.
Looking at c(++)- tutorials they all seem to use SDL2_TTF
which I think is not part of 'core' SDL,
and I cannot find anything like it in the sdlada binding.
So, how would I write "Hello" in a window created like
(No I do not use everything in the code just yet)
with SDL;
with SDL.Error;
with SDL.Log;
with SDL.Video.Palettes;
with SDL.Video.Pixel_Formats;
with SDL.Video.Pixels;
with SDL.Video.Renderers.Makers;
with SDL.Video.Textures.Makers;
with SDL.Video.Windows.Makers;
with SDL.Versions;
with SDL.Video.Rectangles;
procedure Rectangles is
W : SDL.Video.Windows.Window;
Renderer : SDL.Video.Renderers.Renderer;
Texture : SDL.Video.Textures.Texture;
Pixels : SDL.Video.Pixels.ARGB_8888_Access.Pointer;
Pitches : SDL.Video.Pixels.Pitch_Access.Pointer;
W_Size : SDL.Video.Windows.Sizes := (640, 480);
Rectangle1 : SDL.Video.Rectangles.Rectangle := (50,50,50,50);
begin
SDL.Log.Set (Category => SDL.Log.Application, Priority => SDL.Log.Debug);
SDL.Log.Put_Debug ("initilise");
if SDL.Initialise then
SDL.Video.Windows.Makers.Create (Win => W,
Title => "Rektanglar test)",
X => 100,
Y => 100,
Width => 640,
Height => 480,
Flags =>
SDL.Video.Windows.Resizable);
SDL.Log.Put_Debug ("window created");
SDL.Video.Renderers.Makers.Create (Renderer, W);
SDL.Log.Put_Debug ("Renderer created");
SDL.Video.Textures.Makers.Create (Tex => Texture,
Renderer => Renderer,
Format =>
SDL.Video.Pixel_Formats.Pixel_Format_ARGB_8888,
Kind =>
SDL.Video.Textures.Streaming,
Size => W_Size);
SDL.Log.Put_Debug ("Texture created");
Renderer.Draw ( Rectangle => Rectangle1);
SDL.Log.Put_Debug ("Rectangle drawn by rendered");
Renderer.Present;
SDL.Log.Put_Debug ("Rectangle presented by renderer");
else
SDL.Log.Put_Debug ("initialise failed");
end if;
delay 5.0;
W.Finalize;
SDL.Log.Put_Debug ("finalised");
SDL.Finalise;
end Rectangles;
--
--
Björn
next reply other threads:[~2015-12-01 22:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-01 22:27 Björn Lundin [this message]
2015-12-02 16:31 ` Text in sdlada Lucretia
2015-12-02 22:23 ` Björn Lundin
2015-12-04 0:45 ` Luke A. Guest
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox