I asked before about pixel click, and now I managed to get far enough so that noise appeared on the screen. Here's how I get started:
CGDataProviderRef provider;
bitmap = malloc(320*480*4);
provider = CGDataProviderCreateWithData(NULL, bitmap, 320*480*4, NULL);
CGColorSpaceRef colorSpaceRef;
colorSpaceRef = CGColorSpaceCreateDeviceRGB();
ir = CGImageCreate(
320,
480,
8,
32,
4 * 320,
colorSpaceRef,
kCGImageAlphaNoneSkipLast,
provider,
NULL,
NO,
kCGRenderingIntentDefault
);
This is how I draw each frame:
for (int i=0; i<320*480*4; i++) {
bitmap[i] = rand()%256;
}
CGRect rect = CGRectMake(0, 0, 320, 480);
CGContextDrawImage(context, rect, ir);
The problem is that it is terribly slow, about 5 frames per second. I think my buffer publishing path should be wrong. Is it possible to do pixel-based full-screen graphics at all, which I could update at 30 frames per second without using a 3D chip?
Bemmu source
share