blob: aa6d65451ae0d731ce0fd0280ec6ee7648dc0936 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
@implementation MyView2
int __v_sokol_inited = 0;
// Alternative drawRect which calls a frame function with native Cocoa calls
- (void)drawRect:(NSRect)rect {
//puts("drawRect()");
if (__v_sokol_inited == 0) {
_sapp_call_init();
__v_sokol_inited = 1;
}
_sapp_call_frame_native();
}
//- (BOOL)isOpaque {
// return NO;
//}
- (BOOL)canBecomeKeyView {
return YES;
}
- (BOOL)acceptsFirstResponder {
return YES;
}
// - (void)mouseExited:(NSEvent*)event {
// }
// - (void)mouseDown:(NSEvent*)event {
// }
- (BOOL)acceptsFirstMouse:(NSEvent *)event {
return YES;
}
@end
|