From: David Holm <david@realityrift.com>
Subject: Re: New Ada binding to OpenGL
Date: Mon, 30 Dec 2002 22:51:33 GMT
Date: 2002-12-30T22:51:33+00:00 [thread overview]
Message-ID: <V54Q9.3365$FF4.203703@newsb.telia.net> (raw)
In-Reply-To: auqbu3$99orq$1@ID-76083.news.dfncis.de
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
next prev parent reply other threads:[~2002-12-30 22:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-28 6:32 New Ada binding to OpenGL David Holm
2002-12-30 20:50 ` Joachim Schr�er
2002-12-30 21:45 ` David Holm
2003-01-08 20:20 ` Brian Gaffney
2003-01-08 23:47 ` David Holm
2003-01-09 9:55 ` Bobby D. Bryant
2003-01-10 18:33 ` Brian Gaffney
2002-12-30 22:51 ` David Holm [this message]
2003-01-03 18:38 ` Joachim Schr�er
2003-01-03 23:56 ` David Holm
[not found] ` <67HR9.4217$gv.98715@newsfep1-gui.server.ntli.net>
2003-01-05 3:21 ` David Holm
2003-01-03 21:57 ` Bobby D. Bryant
2003-01-04 19:11 ` Joachim Schr�er
2002-12-30 20:54 ` Joachim Schr�er
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox