comp.lang.ada
 help / color / mirror / Atom feed
From: "Joachim Schr�er" <joachim.schroeer@web.de>
Subject: Re: New Ada binding to OpenGL
Date: Mon, 30 Dec 2002 21:50:20 +0100
Date: 2002-12-30T21:50:20+01:00	[thread overview]
Message-ID: <auqbu3$99orq$1@ID-76083.news.dfncis.de> (raw)
In-Reply-To: dAbP9.3047$FF4.185223@newsb.telia.net

Hello,

first of all it's good to see that I'm not the only one left doing Ada and
OpenGL
(also see my pretty old page www.adapower.com/schroer ).
A few remarks concerning your binding:

1) For writing plattform independend OpenGL applications besides GL and GLU
a binding to GLUT should be included.

2) I would prefer not to call the main package Opengl but instead use a name
more related to the original C headers like gl or gl_h.
(A personal reason: All my OpenGL applications and classes are in children
of a package called Opengl. There then are children like
with Win32.Gl; package Opengl.Gl renames Win32.GL;

3) Generally I would not add anything to the binding or alter the binding
generator output more than necessary. It is a thin binding and should
represent the original C binding as far as possible (so you can use the C
based literature). The only requirements: The binding should work and be
platform independed (see remarks below).

4) The subprograms taking system.address parameters are superfluous and
represent a not very Adalike style. It is very staightforward to call a
function with access parameter mode or with a general access type. Simply
declare arrays of aliased variables and pass
The_Array(The_Array'First)'Unchecked_Access. Take the following example to
call
procedure glClipPlane(plane : GLENUM;

                                  equation: access GLDOUBLE); --
./GL/gl.h:791



package Opengl.Clip_Planes is

-- Plane coefficients -----------------------------------------------


A : constant := 1; B : constant := 2; C : constant := 3; D : constant := 4;

-- Plane-type and simple clip-plane constants -----------------------

type Plane is array(A .. D) of aliased Gl.Gldouble;

...


and then in the implementation

procedure Enable(The_Plane : in Plane) is

begin

  Counter := Counter + 1;

  if Counter <= Clip_Plane_Indices'Last then

    Gl.Glclipplane(Plane     => Clip_Plane_Indices(Counter),

                          Equation => The_Plane(A)'Unchecked_Access);

    Gl.Glenable(Clip_Plane_Indices(Counter));

...

5) It's very important to use pure constants for all the integer values as
you did. I saw bindings using typed constants, often of type glenum. As in
Win32 a lot of these types are derived from types in package win32 I expect
problems when now porting from Windows to Linux.

6) A question: Are there problems expected using this binding when running
OpenGL without Mesa being installed say on windows using the old dlls and
archives OpenGL32.dll / Glu32.dll / Glut32.dll,  libOpenGL32.a / libGlu32.a
/ libGlut32.a.
Will my application link and run with headers for OpenGL 1.2 or newer
with underlying binary libs for OpenGL 1.1? (Of course the application does
only use 1.1 features). I could try but maybe someone knows...

Best regards
    Joachim Schroer

"David Holm" <david@realityrift.com> schrieb im Newsbeitrag
news:dAbP9.3047$FF4.185223@newsb.telia.net...
> Hi,
> as the original binding to OpenGL seems to be pretty dead (the only places
> to find it is in AdaSDL and GtkAda) I started a new project.
> My bindings are not based on the old ones. The current version is based on
> MesaLib 5.0.
> At the moment there are only thin bindings but the idea is to implement a
> thick binding as soon as the thin one works as it should.
>
> The binding is located here:
> http://adaopengl.sourceforge.net/
>
> As I'm going away today and won't have much computer access until
> wednesday/thursday I released a preview version (0.1). Please look through
> it and send constructive feedback to me. Also check the Readme before
> mailing me as it contains some implementation notes I scribbled down.
>
> //David Holm




  reply	other threads:[~2002-12-30 20:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-28  6:32 New Ada binding to OpenGL David Holm
2002-12-30 20:50 ` Joachim Schr�er [this message]
2002-12-30 21:45   ` David Holm
2003-01-08 20:20     ` Brian Gaffney
2003-01-08 23:47       ` David Holm
2003-01-09  9:55         ` Bobby D. Bryant
2003-01-10 18:33           ` Brian Gaffney
2002-12-30 22:51   ` David Holm
2003-01-03 18:38     ` Joachim Schr�er
2003-01-03 23:56       ` David Holm
     [not found]         ` <67HR9.4217$gv.98715@newsfep1-gui.server.ntli.net>
2003-01-05  3:21           ` David Holm
2003-01-03 21:57   ` Bobby D. Bryant
2003-01-04 19:11     ` Joachim Schr�er
2002-12-30 20:54 ` Joachim Schr�er
replies disabled

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