Why doesn't Blitz compile this piece of my program, complaining on the memcopy line with the following error?:::
Compiling:BounceTestGravity.bmx
Compile Error:Unable to convert from 'Int' to 'Byte Ptr'
[/Applications/BlitzMaxSetup100/PaulsTests1/BounceTestGravity.bmx;103;5]
Build Error: failed to compile /Applications/BlitzMaxSetup100/PaulsTests1/BounceTestGravity.bmx
psource is defined with Local psource:Byte Ptr initialized with PixmapPixelPtr(img,0,0) which is a pixmap. psize is an integer size in bytes:
I'm trying to do a direct memory copy from the pixel data of a regular pixmap (in memory) to the pixel data of a locked image's pixmap in video ram. If I change the memcopy to a nested for-next loop for x and y, using writepixel and readpixel, it works, but what's wrong with the memcopy line?
Compiling:BounceTestGravity.bmx
Compile Error:Unable to convert from 'Int' to 'Byte Ptr'
[/Applications/BlitzMaxSetup100/PaulsTests1/BounceTestGravity.bmx;103;5]
Build Error: failed to compile /Applications/BlitzMaxSetup100/PaulsTests1/BounceTestGravity.bmx
psource is defined with Local psource:Byte Ptr initialized with PixmapPixelPtr(img,0,0) which is a pixmap. psize is an integer size in bytes:
txtrp:TPixmap=LockImage(txtri,0,True,True) Local pdest:Byte Ptr pdest=PixmapPixelPtr(txtrp,0,0) MemCopy(pdest,psource,psize) ' problem with this! UnlockImage(txtri) DrawImage txtri,objpos[o,0],objpos[o,1]
I'm trying to do a direct memory copy from the pixel data of a regular pixmap (in memory) to the pixel data of a locked image's pixmap in video ram. If I change the memcopy to a nested for-next loop for x and y, using writepixel and readpixel, it works, but what's wrong with the memcopy line?