Sneaking around the Lazarus code, i had a look in the macosall unit, and found an API function called CGImageCreate(). The syntax for it reminds me of CreateDibSection() on windows.
I am unsure how to use it though. I suspect i must create a "dataprovider" that points a memory buffer (?)
Hope someone can help me out with this, I have a lot of code that depends on my graphics library - and getting the blitter working is make or break for my project.
Googlig I found the following CPP code:
provider = CGDataProviderCreateDirectAccess((void*)dispBitsIndex
+ pitch*affectedT
+ affectedL*(depth==32 ? 4 : 2),
pitch * (affectedB-affectedT)-affectedL*(depth==32 ? 4 : 2),
&gProviderCallbacks);
image = CGImageCreate( affectedR-affectedL, affectedB-affectedT, depth==32 ? 8 : 5 /* bitsPerComponent */,
depth /* bitsPerPixel */,
pitch, colorspace, kCGImageAlphaNoneSkipFirst, provider, NULL, 0, kCGRenderingIntentDefault);
clip = CGRectMake(affectedL,height-affectedB, affectedR-affectedL, affectedB-affectedT);
(..)
/* Draw the image to the Core Graphics context */
CGContextDrawImage(targetWindowBlock->context, clip, image);
(..)
CGImageRelease(image);
CGDataProviderRelease(provider);