comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: Re: questions on Ada openGL binding in the GLOBE3D packages
Date: Thu, 02 Aug 2012 04:14:15 -0500
Date: 2012-08-02T04:14:15-05:00	[thread overview]
Message-ID: <jvdgd7$5e3$1@speranza.aioe.org> (raw)
In-Reply-To: b5a9a044-198c-472c-a107-104b26454d05@googlegroups.com

On 8/2/2012 3:50 AM, Egil H�vik wrote:
>  From the OpenGL spec:
> "The declarations shown in this document apply to ANSI C.
>Languages such as C++ and Ada that allow passing of argument type information
>admit simpler declarations and fewer entry points."
>

> So no, the names in an Ada-binding does not have to exactly match the C version.

I know they do NOT HAVE TO be the same as C. That is my point.

They do NOT have to, yes, but it is _better_ if they DO.  Why not keep
the names the same?

It will make it easier to program this in Ada if the binding is the same.

> As for GL_Begin and GL_End, they should have been called just Begin and End, but
> those are reserved words in Ada.
>

NO, they should have been called the same as C. glBegin and glEnd.  No need
to make up new names. The names are already defined. Why chop off anything.

Btw, I just downloaded at the other Ada openGL now

http://adaopengl.sourceforge.net/downloads.php

and I see that the binding there is the SAME as C binding, which
is good. So I am looking at it now.

Here is an example from the file adaopengl\opengl.ads in the
above zip file:

-------------------------------
--  Copyright  (c) 2002-2003, David Holm
--  All rights reserved.
.....
    pragma Import (C, glBegin, "glBegin");
    pragma Import (C, glEnd, "glEnd");
    pragma Import (C, glVertex2d, "glVertex2d");
    pragma Import (C, glVertex2f, "glVertex2f");
----------------------------------

You can see, the Ada binding above matchs the same as the C API.
Even with the mixed case on the Ada side.

I would have liked to use the GLOBE3D openGL binding, because
my understanding it is more updated than the David Holm one which
was last updated in 2002. But it is more important for me to use
a binding which has the same exact names as C as I use C book
to learn openGL and I like the code to look the same.

This was the case with the Fortran binding as well, it have the
same exact API naming as C. So, I see no reason at all to change
the name of the functions, even though I know it is allowed.

regards,
--Nasser





  reply	other threads:[~2012-08-06  2:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jvddr3$uqm$1@speranza.aioe.org>
2012-08-02  8:50 ` questions on Ada openGL binding in the GLOBE3D packages Egil Høvik
2012-08-02  9:14   ` Nasser M. Abbasi [this message]
2012-08-02 10:19     ` Niklas Holsti
2012-08-02 10:46       ` Nasser M. Abbasi
2012-08-02 11:12         ` Egil Høvik
2012-08-02 11:56           ` Georg Bauhaus
2012-08-02 12:12             ` Vasiliy Molostov
2012-08-02 12:01           ` Vasiliy Molostov
2012-08-02 21:12         ` Randy Brukardt
2012-08-02 20:59       ` Randy Brukardt
2012-08-02 12:13     ` Brian Drummond
2012-08-02 15:01       ` Robert A Duff
2012-08-02 21:18         ` Randy Brukardt
2012-08-02 23:15           ` Robert A Duff
2012-08-02 15:31 ` Pascal Obry
replies disabled

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