comp.lang.ada
 help / color / mirror / Atom feed
* Problems with GLUT on NT and "deeper accessibility"
@ 1998-10-30  0:00 Rolf Wester
  1998-10-30  0:00 ` David C. Hoos, Sr.
  1998-10-30  0:00 ` Matthew Heaney
  0 siblings, 2 replies; 5+ messages in thread
From: Rolf Wester @ 1998-10-30  0:00 UTC (permalink / raw)


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







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-10-30  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
1998-10-30  0:00   ` Rolf Wester
1998-10-30  0:00     ` Robert A Duff

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