comp.lang.ada
 help / color / mirror / Atom feed
From: Lucretia <laguest9000@googlemail.com>
Subject: Re: Accessing a sub-array in C from Ada in SDL
Date: Wed, 21 Sep 2016 11:50:47 -0700 (PDT)
Date: 2016-09-21T11:50:47-07:00	[thread overview]
Message-ID: <ae77beb8-e337-4788-95d9-df3528bba1e0@googlegroups.com> (raw)
In-Reply-To: <3d8ecda8-17bf-414c-be81-70914896f29b@googlegroups.com>

On Wednesday, 21 September 2016 18:31:16 UTC+1, Lucretia  wrote:
> Hi,
> 
> I'm gone back to try and get some updates on SDLAda textures (and also surfaces). 
> 
> When locking a texture you get a pointer to the array and a pitch value to the next line. Mapping a 2D or 3D texture data from C onto a 2D or 3D Ada array is quite easy for a full image, by setting the address. So, currently I have this for a full frame:
> 
> Actual_Pixels    : Texture_2D_Array (1 .. Height, 1 .. Width) with
>    Address => To_Address (Pixels);
> 
> 
> But what if you want to lock a partial area of this texture? Ideally, we'd want to be able to set a stride/pitch value in the array declaration, something like:
> 
> Actual_Pixels    : Texture_2D_Array (1 .. Height, 1 .. Width) with
>    Address => To_Address (Pixels),
>    Stride  => Pitch;
> 
> As far as I can see, this is currently not possible, but I can see this as being immensely useful when working with C libs.
> 
> Luke.

A bad doodle to picture it https://snag.gy/A7waEd.jpg


      reply	other threads:[~2016-09-21 18:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 17:31 Accessing a sub-array in C from Ada in SDL Lucretia
2016-09-21 18:50 ` Lucretia [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox