Re: Pointer problems, changing for no reasons

2016-06-10 Thread ketmar via Digitalmars-d-learn
ooops. that solution is provided in Ali's book. sorry for the noise.

Re: Pointer problems, changing for no reasons

2016-06-10 Thread ketmar via Digitalmars-d-learn
On Friday, 10 June 2016 at 08:32:40 UTC, Begah wrote: In the constructor, i copied the textures to the model's inner texture array, and for some reason this caused the problem. So i needed to change to something like : this.textures.length = textures.length; foreach(i; 0..textures.length) {

Re: Pointer problems, changing for no reasons

2016-06-10 Thread Ali Çehreli via Digitalmars-d-learn
On 06/10/2016 01:32 AM, Begah wrote: > I have found the problem and i still don't understand why i was a problem : > struct Model > { > TextureType[] textures; > > this(TextureType[] textures...) { > this.textures = textures[]; > } > } Yeah, that's a bug because the

Re: Pointer problems, changing for no reasons

2016-06-10 Thread Begah via Digitalmars-d-learn
On Friday, 10 June 2016 at 07:28:44 UTC, Begah wrote: On Thursday, 9 June 2016 at 19:00:42 UTC, cy wrote: I can't help but notice that loadModel is not a static member function, yet you don't seem to call it with a Model object in your "get" function. Also have a look at

Re: Pointer problems, changing for no reasons

2016-06-10 Thread Begah via Digitalmars-d-learn
On Thursday, 9 June 2016 at 19:00:42 UTC, cy wrote: I can't help but notice that loadModel is not a static member function, yet you don't seem to call it with a Model object in your "get" function. Also have a look at std.typecons.RefCounted if you want reference counted data.. loadModel

Re: Pointer problems, changing for no reasons

2016-06-09 Thread cy via Digitalmars-d-learn
I can't help but notice that loadModel is not a static member function, yet you don't seem to call it with a Model object in your "get" function. Also have a look at std.typecons.RefCounted if you want reference counted data..

Pointer problems, changing for no reasons

2016-06-09 Thread Begah via Digitalmars-d-learn
I have a really weird bug in my application, i succeeded in making a small program with the bare munimum to show that bug. The full source code of the application + a dub.json file are at https://github.com/Begah/D_Pointer_Problem ( < 300 LOC ) I have a template called ResourceManager