Jump to page: 1 2
Thread overview
OpenCL bindings
Mar 19, 2013
Lemonfiend
Mar 19, 2013
Mike Parker
Mar 19, 2013
Mike Parker
Mar 19, 2013
Lemonfiend
Mar 20, 2013
Mike Parker
Mar 20, 2013
Andrea Fontana
Mar 20, 2013
Jacob Carlborg
Mar 20, 2013
Mike Parker
Mar 20, 2013
Jacob Carlborg
Mar 20, 2013
Jacob Carlborg
Mar 21, 2013
Mike Parker
Mar 21, 2013
Jacob Carlborg
Mar 20, 2013
Andrea Fontana
Mar 20, 2013
Jacob Carlborg
Mar 20, 2013
Andrea Fontana
Mar 20, 2013
Jacob Carlborg
March 19, 2013
Hi,

I'm interested in updating the existing OpenCL bindings (https://github.com/Trass3r/cl4d) so they work with Derelict3, but have never undertaken such a task.
I'm not sure where/how to begin.

Does anyone have any advice? :)
March 19, 2013
On Tuesday, 19 March 2013 at 14:30:19 UTC, Lemonfiend wrote:
> Hi,
>
> I'm interested in updating the existing OpenCL bindings (https://github.com/Trass3r/cl4d) so they work with Derelict3, but have never undertaken such a task.
> I'm not sure where/how to begin.
>
> Does anyone have any advice? :)

Trass3r's binding is static, with a wrapper on top of it. Plus, the binding (in the 'c' package) uses mixins to some end (just gave it a cursory look, so not clear on the details). I don't think there's anything to "update" here. It's a different approach entirely than what I take with Derelict.

My advice is just to start from scratch. Look at the smaller Derelict packages (DerelictAL, DerelictFT, DerelictGLFW3) for the basic layout. I'm not familiar with the OpenCL API. Never used it or looked at it, so I don't know if you'll need something as more complex like the DerelictGL3 package. But the basic idea is to put all type declarations in one module named types.d, all function pointer alias and declarations in functions.d, and then load everything up via a subclass of SharedLibLoader in a module named appropriately for the binding (in this case, cl.d would be a good choice, with derelict.opencl as the package name).

This is actually something I've wanted to get around to for a long time. I'm busier than ever these days so I can't take it on right now for sure. If you do decide to get busy on it, drop by the Derelict forums[1] if you need any help. You could email me, too, but I imagine that any advice I give you could be useful for others wanting to work on a Derelictified binding.
March 19, 2013
On Tuesday, 19 March 2013 at 14:55:10 UTC, Mike Parker wrote:

> This is actually something I've wanted to get around to for a long time. I'm busier than ever these days so I can't take it on right now for sure. If you do decide to get busy on it, drop by the Derelict forums[1] if you need any help. You could email me, too, but I imagine that any advice I give you could be useful for others wanting to work on a Derelictified binding.

[1] http://dblog.aldacron.net/forum/index.php
March 19, 2013
On Tuesday, 19 March 2013 at 14:55:10 UTC, Mike Parker wrote:
> On Tuesday, 19 March 2013 at 14:30:19 UTC, Lemonfiend wrote:
>> Hi,
>>
>> I'm interested in updating the existing OpenCL bindings (https://github.com/Trass3r/cl4d) so they work with Derelict3, but have never undertaken such a task.
>> I'm not sure where/how to begin.
>>
>> Does anyone have any advice? :)
>
> Trass3r's binding is static, with a wrapper on top of it. Plus, the binding (in the 'c' package) uses mixins to some end (just gave it a cursory look, so not clear on the details). I don't think there's anything to "update" here. It's a different approach entirely than what I take with Derelict.

That's a shame.

> My advice is just to start from scratch. Look at the smaller Derelict packages (DerelictAL, DerelictFT, DerelictGLFW3) for the basic layout. I'm not familiar with the OpenCL API. Never used it or looked at it, so I don't know if you'll need something as more complex like the DerelictGL3 package. But the basic idea is to put all type declarations in one module named types.d, all function pointer alias and declarations in functions.d, and then load everything up via a subclass of SharedLibLoader in a module named appropriately for the binding (in this case, cl.d would be a good choice, with derelict.opencl as the package name).

I see. That's a larger project than I'd hoped. Considering I've never created a binding before, is there some kind of tutorial/recommended reading available?

> This is actually something I've wanted to get around to for a long time. I'm busier than ever these days so I can't take it on right now for sure. If you do decide to get busy on it, drop by the Derelict forums[1] if you need any help. You could email me, too, but I imagine that any advice I give you could be useful for others wanting to work on a Derelictified binding.

March 20, 2013
On Tuesday, 19 March 2013 at 15:03:11 UTC, Lemonfiend wrote:

>
> I see. That's a larger project than I'd hoped. Considering I've never created a binding before, is there some kind of tutorial/recommended reading available?
>

There's a page at dlang.org[1], and I have a series of 5 blog posts on the topic over at gamedev.net, starting with part 1[2].

[1] http://dlang.org/interfaceToC.html
[2] http://www.gamedev.net/blog/1140/entry-2254003-binding-d-to-c/
March 20, 2013
On Wednesday, 20 March 2013 at 08:13:45 UTC, Mike Parker wrote:
> On Tuesday, 19 March 2013 at 15:03:11 UTC, Lemonfiend wrote:
>
>>
>> I see. That's a larger project than I'd hoped. Considering I've never created a binding before, is there some kind of tutorial/recommended reading available?
>>
>
> There's a page at dlang.org[1], and I have a series of 5 blog posts on the topic over at gamedev.net, starting with part 1[2].
>
> [1] http://dlang.org/interfaceToC.html
> [2] http://www.gamedev.net/blog/1140/entry-2254003-binding-d-to-c/

You're missing dstep. Using dstep I converted some c-libraries in short time. It's quite easy to use and usually just some minor modification are needed to  adjust auto-generated d interface.
March 20, 2013
On 2013-03-20 12:09, Andrea Fontana wrote:

> You're missing dstep. Using dstep I converted some c-libraries in short
> time. It's quite easy to use and usually just some minor modification
> are needed to  adjust auto-generated d interface.

I was just about to suggest to use dstep. I'm glad to see that you found it useful.

-- 
/Jacob Carlborg
March 20, 2013
On Wednesday, 20 March 2013 at 12:43:13 UTC, Jacob Carlborg wrote:
> On 2013-03-20 12:09, Andrea Fontana wrote:
>
>> You're missing dstep. Using dstep I converted some c-libraries in short
>> time. It's quite easy to use and usually just some minor modification
>> are needed to  adjust auto-generated d interface.
>
> I was just about to suggest to use dstep. I'm glad to see that you found it useful.

Can dstep output function declarations as aliased function pointers in the format I use in Derelict?
March 20, 2013
On Wednesday, 20 March 2013 at 12:43:13 UTC, Jacob Carlborg wrote:
> On 2013-03-20 12:09, Andrea Fontana wrote:
>
>> You're missing dstep. Using dstep I converted some c-libraries in short
>> time. It's quite easy to use and usually just some minor modification
>> are needed to  adjust auto-generated d interface.
>
> I was just about to suggest to use dstep. I'm glad to see that you found it useful.

*Very* useful. I hope it will be updated with some small changes (like anonymous struct alias replacement and d keyword replacement) :)
March 20, 2013
On 2013-03-20 14:25, Mike Parker wrote:

> Can dstep output function declarations as aliased function pointers in
> the format I use in Derelict?

I guess I could make an option for that.

-- 
/Jacob Carlborg
« First   ‹ Prev
1 2