mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 03:21:32 +11:00
fixed tabs
This commit is contained in:
parent
450502f672
commit
2e2bd93a1c
|
@ -26,7 +26,8 @@
|
|||
{
|
||||
(void)rect;
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
|
||||
//CGContextRef context = [[NSGraphicsContext currentContext]];
|
||||
|
||||
printf("drawRect\n");
|
||||
|
||||
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
|
||||
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, draw_buffer, width * height * 4, NULL);
|
||||
|
@ -44,28 +45,46 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
- (BOOL)wantsUpdateLayer
|
||||
{
|
||||
printf("wantsUpdateLayer\n");
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
-(void)updateLayer
|
||||
{
|
||||
printf("update layer\n");
|
||||
// Force the graphics context to clear to black so we don't get a flash of
|
||||
// white until the app is ready to draw. In practice on modern macOS, this
|
||||
// only gets called for window creation and other extraordinary events.
|
||||
self.layer.backgroundColor = NSColor.blackColor.CGColor;
|
||||
ScheduleContextUpdates((SDL_WindowData *) _sdlWindow->driverdata);
|
||||
SDL_SendWindowEvent(_sdlWindow, SDL_WINDOWEVENT_EXPOSED, 0, 0);
|
||||
//NSGraphicsContext* context = [NSGraphicsContext currentContext];
|
||||
//[context scheduleUpdate];
|
||||
|
||||
[context scheduleUpdate];
|
||||
//(void)rect;
|
||||
CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
|
||||
|
||||
//printf("drawRect\n");
|
||||
|
||||
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
|
||||
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, draw_buffer, width * height * 4, NULL);
|
||||
|
||||
CGImageRef img = CGImageCreate(width, height, 8, 32, width * 4, space, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little,
|
||||
provider, NULL, false, kCGRenderingIntentDefault);
|
||||
|
||||
CGColorSpaceRelease(space);
|
||||
CGDataProviderRelease(provider);
|
||||
|
||||
CGContextDrawImage(context, CGRectMake(0, 0, width * scale, height * scale), img);
|
||||
|
||||
CGImageRelease(img);
|
||||
|
||||
//ScheduleContextUpdates((SDL_WindowData *) _sdlWindow->driverdata);
|
||||
//SDL_SendWindowEvent(_sdlWindow, SDL_WINDOWEVENT_EXPOSED, 0, 0);
|
||||
//[context scheduleUpdate];
|
||||
}
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
Loading…
Reference in a new issue