From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5114c1c6ad71f555 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-30 12:56:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!peer1.news.newnet.co.uk!fu-berlin.de!uni-berlin.de!a36ae.pppool.DE!not-for-mail From: "Joachim Schr�er" Newsgroups: comp.lang.ada Subject: Re: New Ada binding to OpenGL Date: Mon, 30 Dec 2002 21:50:20 +0100 Message-ID: References: NNTP-Posting-Host: a36ae.pppool.de (213.6.54.174) Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1041281796 9757562 213.6.54.174 (16 [76083]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:32396 Date: 2002-12-30T21:50:20+01:00 List-Id: 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" 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