Re: [fpc-pascal] AggPas / PTCGraph dynamic memory allocation

2017-11-13 Thread James Richters
>> ClockBuffer_With_Time:=ClockBuffer_original; > >That seems fine. > >> AggClockbuffer^:=ClockBuffer_With_Time^+3*Sizeof(Longint); //Set >> AggClockBuffer to be 3 Longints past ClockBuffer_with_time > >This seems wrong. Try changing that to the following: > > AggClockbuffer :=

Re: [fpc-pascal] AggPas / PTCGraph dynamic memory allocation

2017-11-12 Thread Graeme Geldenhuys
On 2017-11-12 01:27, James Richters wrote: ClockBuffer_With_Time:=ClockBuffer_original; That seems fine. AggClockbuffer^:=ClockBuffer_With_Time^+3*Sizeof(Longint); //Set AggClockBuffer to be 3 Longints past ClockBuffer_with_time This seems wrong. Try changing that to the

Re: [fpc-pascal] AggPas / PTCGraph dynamic memory allocation

2017-11-11 Thread James Richters
>AggPas doesn't care where or what the data buffer is, as long as you tell >AggPas where to start, width, height and stride. > So use GetImage, assign that buffer to a pointer. Increment the pointer by (3 > *Size(Word)) and give that pointer to agg.Attach(). The data is preceded by 3 Longints,

Re: [fpc-pascal] AggPas / PTCGraph dynamic memory allocation

2017-11-11 Thread Graeme Geldenhuys
On 2017-11-11 01:48, James Richters wrote: I can use a dynamic method with PTCGraph with getimage and putimage But if I allocate memory this way, while it works fine with getimage and putimage, I can't figure out how to use it with AggPas because the first 3 words are not part of the bitmap

[fpc-pascal] AggPas / PTCGraph dynamic memory allocation

2017-11-10 Thread James Richters
I've been trying to figure out how to dynamically allocate memory to be used as a screen buffer to display AggPas generated images with PTCGraph. I don't want it hard coded because I do not know what resolution monitor is going to be used. Here is where I am at: I can define a static