comp.lang.ada
 help / color / mirror / Atom feed
* Need Help With GLUT (Apex NT 4.2.0)
@ 2002-12-12 16:44 Nelson Chandler
  2002-12-12 18:16 ` Randy Brukardt
  0 siblings, 1 reply; 2+ messages in thread
From: Nelson Chandler @ 2002-12-12 16:44 UTC (permalink / raw)


Hello All,

I'm trying to learn OpenGL using Ada on a Win2k machine.
When I try to compile the following, I get "Render_Scene is not subtype
conformant with procedure [RM_95 3.10.2(32)]".  This is an example from
"OpenGL SuperBible (2nd ed)" converted (by me) to the general format of the
sample gnat Ada programs that came with GLUT.  I'm using Apex Ada NT 4.2.0.
Can any of you tell me what's wrong and how to fix it?  Thank you.

-Nelson

--
-- File Name: simple.2.ada
--

with Glut;
use Glut;
with Gl;
with Simple_Procs;

procedure Simple is
    Dont_Care : Integer;
begin

    Glutinitdisplaymode (Glut_Single or Glut_Rgb);
    Dont_Care := Glutcreatewindow ("Simple");
    Glutdisplayfunc (Simple_Procs.Render_Scene'Access);  --COMPILER ERROR IS
HERE

    Gl.Glclearcolor (0.0, 0.0, 1.0, 1.0);

    Glutmainloop;

end Simple;

--
-- File Name: simple_procs.1.ada
--
with Glut;

package Simple_Procs is
    procedure Render_Scene;
end Simple_Procs;

--
-- File Name: simple_procs.2.ada
--
with Gl;
package body Simple_Procs is
    procedure Render_Scene is
    begin
        Gl.Glclear (Gl.Gl_Color_Buffer_Bit);
        Gl.Glflush;
    end Render_Scene;
end Simple_Procs;







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

* Re: Need Help With GLUT (Apex NT 4.2.0)
  2002-12-12 16:44 Need Help With GLUT (Apex NT 4.2.0) Nelson Chandler
@ 2002-12-12 18:16 ` Randy Brukardt
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Brukardt @ 2002-12-12 18:16 UTC (permalink / raw)


I don't know anything much about GLUT, but I doubt that the error has
anything to do with that. The error message is fairly clear:
"Render_Scene is not subtype conformant". All this means is that the
subtypes of the parameters of Render_Scene don't match the ones expected
for the access type that you are converting it to. Since Render_Scene
doesn't have any parameters at all, I suspect that the access type does,
and thus you get an error.

Ada checks that the parameters match, so that you (or GLUT in this case)
can't call a routine with one set of parameters that is expecting a
different set.

         Randy.


Nelson Chandler wrote in message ...
>Hello All,
>
>I'm trying to learn OpenGL using Ada on a Win2k machine.
>When I try to compile the following, I get "Render_Scene is not subtype
>conformant with procedure [RM_95 3.10.2(32)]".  This is an example from
>"OpenGL SuperBible (2nd ed)" converted (by me) to the general format of
the
>sample gnat Ada programs that came with GLUT.  I'm using Apex Ada NT
4.2.0.
>Can any of you tell me what's wrong and how to fix it?  Thank you.
>
>-Nelson
>
>--
>-- File Name: simple.2.ada
>--
>
>with Glut;
>use Glut;
>with Gl;
>with Simple_Procs;
>
>procedure Simple is
>    Dont_Care : Integer;
>begin
>
>    Glutinitdisplaymode (Glut_Single or Glut_Rgb);
>    Dont_Care := Glutcreatewindow ("Simple");
>    Glutdisplayfunc (Simple_Procs.Render_Scene'Access);  --COMPILER
ERROR IS
>HERE
>
>    Gl.Glclearcolor (0.0, 0.0, 1.0, 1.0);
>
>    Glutmainloop;
>
>end Simple;
>
>--
>-- File Name: simple_procs.1.ada
>--
>with Glut;
>
>package Simple_Procs is
>    procedure Render_Scene;
>end Simple_Procs;
>
>--
>-- File Name: simple_procs.2.ada
>--
>with Gl;
>package body Simple_Procs is
>    procedure Render_Scene is
>    begin
>        Gl.Glclear (Gl.Gl_Color_Buffer_Bit);
>        Gl.Glflush;
>    end Render_Scene;
>end Simple_Procs;
>
>
>
>





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

end of thread, other threads:[~2002-12-12 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-12 16:44 Need Help With GLUT (Apex NT 4.2.0) Nelson Chandler
2002-12-12 18:16 ` Randy Brukardt

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