Thread overview
State of OpenGL bindings
Nov 04, 2013
Guilherme Vieira
Nov 04, 2013
Jacob Carlborg
Nov 04, 2013
Mike Parker
Nov 04, 2013
Dav1d
Nov 04, 2013
Kiith-Sa
Nov 04, 2013
Dav1d
Nov 04, 2013
Andrej Mitrovic
Nov 04, 2013
Dav1d
Nov 04, 2013
Marco Leise
November 04, 2013
Hi, all.

If I wanted to create an OpenGL project in D, what would be supported by current bindings? Are the bindings out-of-date compared to the C library versions or are they the same?

Thank you.


-- 
Atenciosamente / Sincerely,
Guilherme PrĂ¡ Vieira

<http://www.linkedin.com/in/n2liquid>
<http://www.linkedin.com/in/n2liquid>
 <http://www.linkedin.com/in/n2liquid>


November 04, 2013
On 2013-11-04 07:31, Guilherme Vieira wrote:
> Hi, all.
>
> If I wanted to create an OpenGL project in D, what would be supported by
> current bindings? Are the bindings out-of-date compared to the C library
> versions or are they the same?

I would recommend using Derelict. It contains bindings for 1.1 to 4.3, as far as I can see. Derelict is usually in a very good shape.

https://github.com/DerelictOrg/DerelictGL3

Use via dub: http://code.dlang.org/packages/derelict-gl3

-- 
/Jacob Carlborg
November 04, 2013
On 11/4/2013 4:30 PM, Jacob Carlborg wrote:
> On 2013-11-04 07:31, Guilherme Vieira wrote:
>> Hi, all.
>>
>> If I wanted to create an OpenGL project in D, what would be supported by
>> current bindings? Are the bindings out-of-date compared to the C library
>> versions or are they the same?
>
> I would recommend using Derelict. It contains bindings for 1.1 to 4.3,
> as far as I can see. Derelict is usually in a very good shape.
>
> https://github.com/DerelictOrg/DerelictGL3
>
> Use via dub: http://code.dlang.org/packages/derelict-gl3
>


Re being out-of-date: DerelictGL3 has support for up to version 4.3. Support for 4.4 is on the TODO list.
November 04, 2013
On Monday, 4 November 2013 at 06:31:42 UTC, Guilherme Vieira wrote:
> Hi, all.
>
> If I wanted to create an OpenGL project in D, what would be supported by
> current bindings? Are the bindings out-of-date compared to the C library
> versions or are they the same?
>
> Thank you.

You can also use "glad":

https://github.com/Dav1dde/glad

Supporting every OpenGL version/configuration you want. Furthermore supporting complete WGL/EGL/GLX (if you want). All you need is Python to generate your OpenGL  loader you want, or you simply take the already generated ones: https://github.com/Dav1dde/glad/tree/d

So far glad is used by myself, a few guys from #OpenGL (using the C loader) and there are also a few D users.

Why glad over Derelict? Always up to date, 100% spec conform, not so "fat", only generates what you need. E.g. I am using here a glad loader https://github.com/Dav1dde/BraLa/tree/master/src/d/glad/glad/gl with a 4.4 OpenGL core profile with only the anisotropic extension loaded.

There are a few things still on my todo: e.g. the open issue, or lazy loading, or generating debug functions or lazy loading, patches welcome ;).

- David
November 04, 2013
I never felt Derelict wasn't "up to date". Also, it provides you with bindings to other essential libraries (e.g. SDL2, SFML, OpenAL, Assimp, etc.). And it's been actively maintained since forever, unlikely to die in the forseeable future.
November 04, 2013
On Monday, 4 November 2013 at 13:16:40 UTC, Kiith-Sa wrote:
> I never felt Derelict wasn't "up to date". Also, it provides you with bindings to other essential libraries (e.g. SDL2, SFML, OpenAL, Assimp, etc.). And it's been actively maintained since forever, unlikely to die in the forseeable future.

Derelict had some minor issues already because of manual bindings. But I agree that's not really a problem. But the thing I hate most about Derelict is, it loads everything dynamically, even though in lots of cases dynamic loading is inferior to static linking (eg glfw, glfw even recommends to link statically). That is a bad habit especially for newbies who dont even know better. Writing this from my phone now, otherwise I could link a little rant about dynamic loading. When there is interest, I will link it when I am at home.
November 04, 2013
On 11/4/13, Dav1d <d@dav1d.de> wrote:
> But the thing I hate most about Derelict is, it loads everything dynamically

But glad does the same thing? I guess you're planning on adding static linking to glad?
November 04, 2013
On Monday, 4 November 2013 at 14:30:40 UTC, Andrej Mitrovic wrote:
> On 11/4/13, Dav1d <d@dav1d.de> wrote:
>> But the thing I hate most about Derelict is, it loads everything dynamically
>
> But glad does the same thing? I guess you're planning on adding static
> linking to glad?

You cant link OpenGL statically, I was referring to all the other bindings Derelic provides.
November 04, 2013
Am Mon, 4 Nov 2013 15:30:27 +0100
schrieb Andrej Mitrovic <andrej.mitrovich@gmail.com>:

> On 11/4/13, Dav1d <d@dav1d.de> wrote:
> > But the thing I hate most about Derelict is, it loads everything dynamically
> 
> But glad does the same thing? I guess you're planning on adding static linking to glad?

OpenGL is (for the most part) just a specification. It is usually implemented by graphics card vendors and as such hardware dependent code that cannot be linked in statically.

I guess you _could_ statically link software implementations like the one that is part of Mesa GL.

-- 
Marco