comp.lang.ada
 help / color / mirror / Atom feed
From: gautier_niouzes@hotmail.com (Gautier)
Subject: Re: generic type identification
Date: 5 Jan 2003 02:03:51 -0800
Date: 2003-01-05T10:03:51+00:00	[thread overview]
Message-ID: <17cd177c.0301050203.2c7b6e14@posting.google.com> (raw)
In-Reply-To: oDNR9.4572$LY2.262334@newsc.telia.net

David Holm <david@realityrift.com>:

> In this case I'd rather create a couple of overloaded procedures as the idea 
> of the thick binding is to make it easier to access OpenGL from Ada.
> This method would just make it harder since it would require one extra call 
> for each time you pass values to OpenGL.

It's the simplest variant IMHO too...
Excerpt from my home-made bindings to OpenGL 1.1:

package GL is

  ....

  -- Specify vertices
  procedure Vertex (x,y: GL.double);
  procedure Vertex_f (x,y: GL.float);

  procedure Vertex (x,y: GL.int);
  procedure Vertex_s (x,y: GL.short);

  procedure Vertex (x,y,z: GL.double);
  procedure Vertex_f (x,y,z: GL.float);

  ....

private

  ....

  -- Wrapper for vertex2d
  procedure vertex2d (x,y: GL.double);
  procedure vertex (x,y: GL.double) renames vertex2d;

  -- Wrapper for vertex2f
  procedure vertex2f (x,y: GL.float);
  procedure vertex_f (x,y: GL.float) renames vertex2f;

  ....
  pragma Import (Stdcall, Vertex3d, "glVertex3d");
  pragma Import (Stdcall, Vertex3f, "glVertex3f");
  pragma Import (Stdcall, Vertex3i, "glVertex3i");
  ....

end GL;

Write me for an applet that produces the "renames" part
________________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!



  reply	other threads:[~2003-01-05 10:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-04  1:50 generic type identification David Holm
2003-01-04  2:04 ` chris.danx
2003-01-04  5:39 ` tmoran
2003-01-04 12:39   ` David Holm
2003-01-04 16:13     ` James S. Rogers
2003-01-05  3:28       ` David Holm
2003-01-05 10:03         ` Gautier [this message]
2003-01-04 19:27     ` tmoran
2003-01-05  3:25       ` David Holm
2003-01-05  5:42         ` tmoran
2003-01-06 17:56     ` Stephen Leake
replies disabled

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