mac: keyboard events and other nice refactors. they get sent to the opengl window but the callback isn't fired for some reason
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
39db13fa48
commit
e2bcd7b9e9
3 changed files with 588 additions and 113 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#include "Mw/BaseTypes.h"
|
||||
#include "Mw/Core.h"
|
||||
#include "Mw/StringDefs.h"
|
||||
#include <Mw/Milsko.h>
|
||||
|
|
@ -28,10 +29,8 @@ static int create(MwWidget handle) {
|
|||
|
||||
printf("%d %d\n", width, height);
|
||||
|
||||
MacOpenGLWidget *o = r = [[MacOpenGLWidget alloc]
|
||||
handle->internal = [[MacOpenGLWidget alloc]
|
||||
initWithView:[handle->lowlevel->cocoa.real getView]];
|
||||
|
||||
handle->internal = r;
|
||||
handle->lowlevel->common.copy_buffer = 0;
|
||||
|
||||
MwSetDefault(handle);
|
||||
|
|
@ -96,6 +95,19 @@ static void func_handler(MwWidget handle, const char *name, void *out,
|
|||
[self->glc makeCurrentContext];
|
||||
};
|
||||
- (void)swapBuffer {
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSEvent *event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined
|
||||
location:NSMakePoint(0, 0)
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:0
|
||||
context:nil
|
||||
subtype:0
|
||||
data1:0
|
||||
data2:0];
|
||||
[NSApp postEvent:event atStart:YES];
|
||||
[pool release];
|
||||
|
||||
[self->glc flushBuffer];
|
||||
};
|
||||
- (void *)getProcAddressWithName:(const char *)name {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue