fixed tabs

This commit is contained in:
Daniel Collin 2018-10-20 09:31:46 +02:00
parent 450502f672
commit 2e2bd93a1c

View file

@ -26,7 +26,8 @@
{ {
(void)rect; (void)rect;
CGContextRef context = [[NSGraphicsContext currentContext] CGContext]; CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
//CGContextRef context = [[NSGraphicsContext currentContext]];
printf("drawRect\n");
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, draw_buffer, width * height * 4, NULL); CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, draw_buffer, width * height * 4, NULL);
@ -44,28 +45,46 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
- (BOOL)wantsUpdateLayer - (BOOL)wantsUpdateLayer
{ {
printf("wantsUpdateLayer\n");
return TRUE; return TRUE;
} }
*/
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
-(void)updateLayer -(void)updateLayer
{ {
printf("update layer\n");
// Force the graphics context to clear to black so we don't get a flash of // 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 // white until the app is ready to draw. In practice on modern macOS, this
// only gets called for window creation and other extraordinary events. // only gets called for window creation and other extraordinary events.
self.layer.backgroundColor = NSColor.blackColor.CGColor; self.layer.backgroundColor = NSColor.blackColor.CGColor;
ScheduleContextUpdates((SDL_WindowData *) _sdlWindow->driverdata); //NSGraphicsContext* context = [NSGraphicsContext currentContext];
SDL_SendWindowEvent(_sdlWindow, SDL_WINDOWEVENT_EXPOSED, 0, 0); //[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];
} }
*/
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////