Get difficulties with variadics

Flamaros flamaros.xavier at gmail.com
Sun May 12 06:43:54 PDT 2013


On Sunday, 12 May 2013 at 01:22:16 UTC, evilrat wrote:
> On Saturday, 11 May 2013 at 22:01:33 UTC, Flamaros wrote:
>> Thanks a lot, I think using Variant[] is a better way. For the 
>> moment (maybe for few minutes) it's necessary to always give 
>> the Variant array to the getResource method, but it can be 
>> null.
>>
>> I actually use derelict3, but for this VBO isn't not necessary 
>> to have something much more advanced as it's only for a Quad 
>> generated by hand. I am sharing the indexes VBO of Quads.
>>
>> The operational parameters can be useful to load a Texture 
>> from an Image instance instead of only the filePath for 
>> exemple. filePath also act as key to be able to get resources.
>
> you don't even need to always pass null when you don't need 
> anything, use default parameters.
>
> void someFunc(Variant[] array = null) {...}
> or
> void anotherFunc(Variant[] array = Variant[].init) {...}
>
> ok, if this is just a part of tutorial or demo i don't bother 
> with my "tips" about api design anymore.

We hope to open our code in few weeks, and as it will be a 
library, help on API design will be welcome. For the moment we 
are working a doing a prototype, with core features to see if the 
project is viable.


More information about the Digitalmars-d-learn mailing list