Convert std.container.array to void[] and/or pass to OpenGL functions like glBuffer(Sub)Data

ParticlePeter via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 17 06:16:11 PDT 2015


On Wednesday, 17 June 2015 at 13:07:11 UTC, Alex Parrill wrote:
> On Wednesday, 17 June 2015 at 13:04:28 UTC, ParticlePeter wrote:
>> I use wrapper functions taking void[] arrays to forward them 
>> comfortably to mentioned OpenGL functions. This works with 
>> static and dynamic build in arrays, but I don't see a way how 
>> I could access (cast) the raw data of a std.container.array to 
>> forward it to these wrapper functions. std.array(Range)(Range 
>> r) does a copy which I would like to avoid. Any advice ?
>
> Try slicing it: `array[]`

That gives me a range, which I could convert to an array with 
std.array(Range)(Range
r) which I want to avoid.


More information about the Digitalmars-d-learn mailing list