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 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!l14g2000yqb.googlegroups.com!not-for-mail From: Yves Bailly Newsgroups: comp.lang.ada Subject: Re: OpenGL in Ada Date: Fri, 8 Oct 2010 13:42:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <33c3fe9d-e8e5-4511-b69e-4920b49ac783@l14g2000yqb.googlegroups.com> References: <2f006952-2814-4775-935c-e9f095c7f79c@k10g2000yqa.googlegroups.com> NNTP-Posting-Host: 82.242.195.245 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1286570536 6056 127.0.0.1 (8 Oct 2010 20:42:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 8 Oct 2010 20:42:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l14g2000yqb.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:14453 Date: 2010-10-08T13:42:16-07:00 List-Id: Lucretia wrote: > On Oct 5, 10:23=A0pm, Yves Bailly wrote: > > > 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. > > That is something that shouldn't be done here. Most of the API can be > linked to directly with pragma import, the Win32 version needs to use > a different type of import, stdcall, I think; see the GNAT manuals. > > glGetProcAddress is for getting the address of subprograms from a DLL, > i.e. the GL extensions. Actually, I don't think it's enough, because different drivers and hardwares provide different OpenGL coverage. For example, maybe you can use pragma import(C, "glGenFramebuffers") with an OpenGL lib providing at least OpenGL 3, but it will fail if the lib provides only an older version. What is an extension in a given GL version may not be in another. The use of a GetProcAddress function allows to work in any case, just some subprogram pointers stay null. Note that it's the only dependency imported from SDL, it could be replaced by a hand- written equivalent, therefore removing the dependency (I'm just too lazy for this). To be able to use "pragma import" in any case would require to link with something like Glew. That said, remains the question of the creation of the GL context, the handling of events and so on, much things very system-dependent. As far as I know, GLUT is just too old for this, e.g. it doesn't handle Unicode at all. But I guess that's another story. > It would be nice to have just 1 combined effort for GL under a BSD > licence so we can get rid of the x amount of already existing > versions, I think I know of about 4-5 at the moment. I agree with that, however I personaly don't think I would be able to organise nor manage such a "combined effort". But I would be glad to help in such an effort, assuming I could be of any help of course. Regards,