comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Problems with GLUT on NT and "deeper accessibility"
Date: 1998/10/30
Date: 1998-10-30T00:00:00+00:00	[thread overview]
Message-ID: <m3sog624rz.fsf@mheaney.ni.net> (raw)
In-Reply-To: 3639682C.AA824493@ilt.fhg.de

Rolf Wester <WESTER@ilt.fhg.de> writes:

Use T'Unchecked_Access.




> Hi,
> 
> I installed GNAT, AdaWin32 and  GLUT according to the instructions on
> "Jerry's Ada on Win32 Page". I also downloaded the GLUT sources. When I
> try to compile the program ada_sphere_procs.adb (with win32.gl,
> win32.glu) I get the following error message:
> 
> Compiling...
> ada_sphere_procs.adb:41:38: object has deeper accessibility level than
> access type
> ada_sphere_procs.adb:42:39: object has deeper accessibility level than
> access type
> 
> The code fragment is:
>       procedure init is
> 
>        light_diffuse : array(0 .. 3) of aliased GLfloat :=
>                     (1.0, 0.0, 0.0, 1.0);
>        light_position : array(0 .. 3) of aliased GLfloat :=
>                     (1.0, 1.0, 1.0, 0.0);
> 
>        begin
>        glClearColor(0.1, 0.1, 0.1, 0.0);
> 
>        glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse(0)'access); --
> line 41
>        glLightfv(GL_LIGHT0, GL_POSITION, light_position(0)'access); --
> line 42
> 
> The function glLightfv is defined in win32-gl.ads as:
>        procedure glLightfv(
>                 light : GLenum;
>                 pname : GLenum;
>                 params: ac_GLfloat);
> 
> and ac_GLfloat is  defined as:
>        type GLfloat is new Win32.FLOAT;
>        type ac_GLfloat is access constant GLfloat;
> 
> When I change the code to:
> 
>      procedure init is
> 
>         light_diffuse : array(0 .. 3) of aliased GLfloat :=
>                (1.0, 0.0, 0.0, 1.0);
>         light_position : array(0 .. 3) of aliased GLfloat :=
>                (1.0, 1.0, 1.0, 0.0);
>          type my_ac_GLfloat is access constant GLfloat;
>          myFA : my_ac_GLfloat;
>          FA   : ac_GLfloat;
>   begin
>         glClearColor(0.1, 0.1, 0.1, 0.0);
> 
>          myFA := light_diffuse(0)'access;  --line 43
>          FA   := light_diffuse(0)'access;    -- line 44
> 
>          glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse(0)'access);
> --line 46
>          glLightfv(GL_LIGHT0, GL_POSITION, light_position(0)'access); --
> line 47
> 
> I get the following error messages:
> 
> Compiling...
> ada_sphere_procs.adb:44:13: object has deeper accessibility level than
> access type
> ada_sphere_procs.adb:46:38: object has deeper accessibility level than
> access type
> ada_sphere_procs.adb:47:39: object has deeper accessibility level than
> access type
> 
> With my own my_ac_GLfloat on line 43 it's O.K. with the win32.gl
> ac_GLfloat
> used on line 44 it's an error!
> 
> I would be very appreciative for any help.
> 
> Thanks in anticipation
> 
> - Rolf
> 
> P.S.: Could anybody explain me the difference between
>        type ac_GLfloat is access constant GLfloat;
> and
>        type ac_GLfloat is access all GLfloat;
> 
> 
> ----------------------------------------------------------------------------
> 
> Rolf Wester
> Fraunhofer-Institute for Laser Technology
> Aachen
> Germany
> wester@ilt.fhg.de




  parent reply	other threads:[~1998-10-30  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-30  0:00 Problems with GLUT on NT and "deeper accessibility" Rolf Wester
1998-10-30  0:00 ` David C. Hoos, Sr.
1998-10-30  0:00 ` Matthew Heaney [this message]
1998-10-30  0:00   ` Rolf Wester
1998-10-30  0:00     ` Robert A Duff
replies disabled

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