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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,75fb93409baf1e22,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!a15g2000yqm.googlegroups.com!not-for-mail From: Yves Bailly Newsgroups: comp.lang.ada Subject: OpenGL in Ada Date: Tue, 5 Oct 2010 14:23:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 82.242.195.245 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1286313822 22761 127.0.0.1 (5 Oct 2010 21:23:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 5 Oct 2010 21:23:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a15g2000yqm.googlegroups.com; posting-host=82.242.195.245; posting-account=bq4tKgoAAACL_Bm1LT74t0bhFtiukbrL User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.3 (KHTML, like Gecko) konqueror/4.5.1 Safari/533.3,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14401 Date: 2010-10-05T14:23:42-07:00 List-Id: Greetings to everyone in this group, This is my very first posting, so please apologize if I do something really wrong (as well as for my english, it's not my native language). I have created a small program which generates a pair of files, namely "gl.ads" and "gl.adb", to use OpenGL from Ada. The files are generated by reading the official OpenGL specifications files (namely "enum.spec", "gl.spec" and "gl.tm") which can be found from the official OpenGL page http://www.opengl.org/registry/ (no GLU nor GLUT though). The OpenGL subprograms are named according to the usual C naming scheme ("glBegin", "glVertex3d" and so on), so the result looks more like C than like Ada, but at least it allows to read tutorials more easily (as most of them are based on C). So the generated binding is rather low-level (I think "thin binding" is the appropriate wording). The subprograms are not imported using "pragma Import", but rather declared as access to subprograms (procedures or functions). The access are then resolved in a lenghty "Init_GL" procedure, which relies on the "glGetProcAddress" function imported from SDL. So the generated binding requires SDL to work. I'm far from being an Ada expert. I would really appreciate if someone interested in using OpenGL with Ada would accept to spend some time: - to point me to the horrible things I probably wrote in this program; - to tell if the generated binding is of good or bad quality. Thanks for your time and best regards, -- Yves Bailly yves.bailly@gmail.com