2021-01-23 10:25:40 +01:00
|
|
|
|
|
|
|
@implementation MyView2
|
|
|
|
|
2021-04-23 12:33:48 +02:00
|
|
|
int __v_sokol_inited = 0;
|
2021-04-14 02:59:34 +02:00
|
|
|
|
2021-01-23 10:25:40 +01:00
|
|
|
// Alternative drawRect which calls a frame function with native Cocoa calls
|
|
|
|
- (void)drawRect:(NSRect)rect {
|
2021-04-23 12:33:48 +02:00
|
|
|
//puts("drawRect()");
|
|
|
|
if (__v_sokol_inited == 0) {
|
2021-04-14 02:59:34 +02:00
|
|
|
_sapp_call_init();
|
2021-04-23 12:33:48 +02:00
|
|
|
__v_sokol_inited = 1;
|
2021-04-14 02:59:34 +02:00
|
|
|
}
|
|
|
|
_sapp_call_frame_native();
|
2021-01-23 10:25:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//- (BOOL)isOpaque {
|
|
|
|
// return NO;
|
|
|
|
//}
|
|
|
|
|
|
|
|
- (BOOL)canBecomeKeyView {
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
- (BOOL)acceptsFirstResponder {
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2021-02-17 06:56:58 +01:00
|
|
|
// - (void)mouseExited:(NSEvent*)event {
|
|
|
|
// }
|
2021-01-23 10:25:40 +01:00
|
|
|
|
2021-02-17 06:56:58 +01:00
|
|
|
// - (void)mouseDown:(NSEvent*)event {
|
|
|
|
// }
|
2021-01-23 10:25:40 +01:00
|
|
|
|
|
|
|
- (BOOL)acceptsFirstMouse:(NSEvent *)event {
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|