<div dir="ltr">Here's an example of a typical C API that's begging to be wrapped up all nice:<div><a href="http://fujiengine.org/docs/group___m_f_material.html">http://fujiengine.org/docs/group___m_f_material.html</a><br>
</div><div><br></div><div>And it's counterpart: <a href="https://github.com/TurkeyMan/fuji/blob/master/dist/include/d2/fuji/material.d">https://github.com/TurkeyMan/fuji/blob/master/dist/include/d2/fuji/material.d</a></div>
<div>You can see some initial experiments I toyed with down the bottom. Abusing the class syntax, and implementing a range interface for the material parameters, but this sucks in a variety of ways...</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 19 September 2013 02:19, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div class="h5">On 19 September 2013 02:14, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com" target="_blank">andrej.mitrovich@gmail.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 9/18/13, Manu <<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>> wrote:<br>
> And in D:<br>
><br>
>   struct Thing;<br>
>   extern (C) Thing* MakeThing();<br>
><br>
> The question is, does this suck?<br>
> D currently can't allocate an array of Thing*'s for some weird reason.<br>
<br>
</div>This is just a current bug that will be fixed. As a workaround you can use this:<br>
<br>
struct Thing<br>
{<br>
    @disable this();<br>
    @disable this(this);<br>
}<br>
<br>
This will ensure "Thing" will never be copied by value, and you can<br>
only use it with a pointer.<br>
</blockquote></div><br></div></div></div><div class="gmail_extra">But since I'm always dealing with a pointer rather than a real type, I can't implement logic to inc/dec the ref-count on assignment. And how do I handle destruction/garbage collection?</div>

</div>
</blockquote></div><br></div>