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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,5114c1c6ad71f555 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-30 14:51:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!wanadoo.fr!opentransit.net!newsfeed.online.be!130.240.42.8.MISMATCH!luth.se!news-stob.telia.net!telia.net!194.22.194.4.MISMATCH!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: David Holm Subject: Re: New Ada binding to OpenGL Newsgroups: comp.lang.ada References: User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit Message-ID: Date: Mon, 30 Dec 2002 22:51:33 GMT NNTP-Posting-Host: 217.208.105.23 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1041288693 217.208.105.23 (Mon, 30 Dec 2002 23:51:33 CET) NNTP-Posting-Date: Mon, 30 Dec 2002 23:51:33 CET Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:32399 Date: 2002-12-30T22:51:33+00:00 List-Id: Joachim Schr�er wrote: > 4) The subprograms taking system.address parameters are superfluous and > represent a not very Adalike style. It is very staightforward to call a > function with access parameter mode or with a general access type. Simply > declare arrays of aliased variables and pass > The_Array(The_Array'First)'Unchecked_Access. Take the following example to > call > procedure glClipPlane(plane : GLENUM; > > equation: access GLDOUBLE); -- > ./GL/gl.h:791 > > > > package Opengl.Clip_Planes is > > -- Plane coefficients ----------------------------------------------- > > > A : constant := 1; B : constant := 2; C : constant := 3; D : constant := > 4; > > -- Plane-type and simple clip-plane constants ----------------------- > > type Plane is array(A .. D) of aliased Gl.Gldouble; > > ... > > > and then in the implementation > > procedure Enable(The_Plane : in Plane) is > > begin > > Counter := Counter + 1; > > if Counter <= Clip_Plane_Indices'Last then > > Gl.Glclipplane(Plane => Clip_Plane_Indices(Counter), > > Equation => The_Plane(A)'Unchecked_Access); > > Gl.Glenable(Clip_Plane_Indices(Counter)); > > ... > How can I pass null addresses this way? With System.Address I could use GLNULL : System.Address renames System.Null_Address; //David