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.66.194.129 with SMTP id hw1mr7375593pac.92.1474479069014; Wed, 21 Sep 2016 10:31:09 -0700 (PDT) X-Received: by 10.157.13.110 with SMTP id 101mr1019517oti.13.1474479068966; Wed, 21 Sep 2016 10:31:08 -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!u18no2748251ita.0!news-out.google.com!b4ni7836iti.0!nntp.google.com!x192no2877715itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 21 Sep 2016 10:31:08 -0700 (PDT) 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 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3d8ecda8-17bf-414c-be81-70914896f29b@googlegroups.com> Subject: Accessing a sub-array in C from Ada in SDL From: Lucretia Injection-Date: Wed, 21 Sep 2016 17:31:08 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:31832 Date: 2016-09-21T10:31:08-07:00 List-Id: 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.