comp.lang.ada
 help / color / mirror / Atom feed
From: Yves Bailly <yves.bailly@gmail.com>
Subject: Re: OpenGL in Ada
Date: Fri, 8 Oct 2010 13:42:16 -0700 (PDT)
Date: 2010-10-08T13:42:16-07:00	[thread overview]
Message-ID: <33c3fe9d-e8e5-4511-b69e-4920b49ac783@l14g2000yqb.googlegroups.com> (raw)
In-Reply-To: 2f006952-2814-4775-935c-e9f095c7f79c@k10g2000yqa.googlegroups.com



Lucretia wrote:
> On Oct 5, 10:23 pm, Yves Bailly <yves.bai...@gmail.com> 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,



  reply	other threads:[~2010-10-08 20:42 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 21:23 OpenGL in Ada Yves Bailly
2010-10-06  3:45 ` anon
2010-10-06  5:10   ` Yves Bailly
2010-10-06  9:51     ` Alex R. Mosteo
2010-10-06 10:38       ` Yves Bailly
2010-10-06 10:59         ` Ludovic Brenta
2010-10-06 16:07           ` Pascal Obry
2010-10-06 17:32             ` Yves Bailly
2010-10-06  8:38 ` Gautier write-only
2010-10-07  1:52   ` BrianG
2010-10-07 22:06     ` Yves Bailly
2010-10-08 17:11     ` Shark8
2010-10-08 15:02 ` Lucretia
2010-10-08 20:42   ` Yves Bailly [this message]
2010-10-10 19:49     ` Vadim Godunko
  -- strict thread matches above, loose matches on Subject: below --
2010-07-08  2:42 Shark8
2010-07-08 14:15 ` John B. Matthews
2010-07-09  2:18   ` anon
2010-07-12 16:51   ` Warren
2010-07-13 12:26     ` Ludovic Brenta
2010-07-13 13:13       ` Warren
2010-07-09 11:43 ` Gautier write-only
2010-07-09 15:11 ` Gene
2010-07-09 17:38   ` Shark8
2010-07-09 20:54     ` Gene
2010-07-12 17:04       ` Warren
2010-07-10  4:00     ` BrianG
2010-07-10 11:47       ` Gautier write-only
2010-07-11  2:45         ` BrianG
2010-07-11  4:10           ` Gautier write-only
2010-07-11  5:30       ` tmoran
2010-07-11 20:46         ` anon
2010-07-12 14:17           ` Shark8
2010-07-13  0:45             ` BrianG
2010-07-13 17:50               ` anon
2010-07-13 18:37                 ` Shark8
2015-01-30 14:45 ` Lucretia
2015-01-30 18:41   ` David Botton
2009-10-28 17:12 Opengl " Pablo
2009-10-28 18:01 ` Pascal Obry
2009-10-28 19:04   ` John B. Matthews
2009-10-29  6:11 ` Gautier write-only
2000-04-27  0:00 OpenGl in ADA Anderson
2000-04-27  0:00 ` 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