comp.lang.ada
 help / color / mirror / Atom feed
From: Lucretia <laguest9000@googlemail.com>
Subject: Accessing a sub-array in C from Ada in SDL
Date: Wed, 21 Sep 2016 10:31:08 -0700 (PDT)
Date: 2016-09-21T10:31:08-07:00	[thread overview]
Message-ID: <3d8ecda8-17bf-414c-be81-70914896f29b@googlegroups.com> (raw)

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.


             reply	other threads:[~2016-09-21 17:31 UTC|newest]

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

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