From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.237.53.208 with SMTP id d16mr7878068qte.43.1474483847581; Wed, 21 Sep 2016 11:50:47 -0700 (PDT) X-Received: by 10.157.43.242 with SMTP id u105mr1066957ota.17.1474483847529; Wed, 21 Sep 2016 11:50:47 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!m9no1676896qte.0!news-out.google.com!w143ni8217itb.0!nntp.google.com!u18no2777463ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 21 Sep 2016 11:50:47 -0700 (PDT) In-Reply-To: <3d8ecda8-17bf-414c-be81-70914896f29b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:c7d:3cda:7600:932b:b705:6315:5a80; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS NNTP-Posting-Host: 2a02:c7d:3cda:7600:932b:b705:6315:5a80 References: <3d8ecda8-17bf-414c-be81-70914896f29b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Accessing a sub-array in C from Ada in SDL From: Lucretia Injection-Date: Wed, 21 Sep 2016 18:50:47 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:31833 Date: 2016-09-21T11:50:47-07:00 List-Id: 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