clean up debug code printf's
This commit is contained in:
parent
b5a87d818e
commit
6eccb8b971
|
@ -49,8 +49,6 @@
|
||||||
#import "org_lwjgl_MacOSXSysImplementation.h"
|
#import "org_lwjgl_MacOSXSysImplementation.h"
|
||||||
#import "context.h"
|
#import "context.h"
|
||||||
|
|
||||||
#define WAIT_DELAY 100
|
|
||||||
|
|
||||||
static NSOpenGLPixelFormat *default_format = nil;
|
static NSOpenGLPixelFormat *default_format = nil;
|
||||||
|
|
||||||
static NSAutoreleasePool *pool;
|
static NSAutoreleasePool *pool;
|
||||||
|
@ -95,10 +93,10 @@ static NSAutoreleasePool *pool;
|
||||||
_modifierFlags = 0;
|
_modifierFlags = 0;
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_pixelFormat = [format retain];
|
_pixelFormat = [format retain];
|
||||||
//[[NSNotificationCenter defaultCenter] addObserver:self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
// selector:@selector(_surfaceNeedsUpdate:)
|
selector:@selector(_surfaceNeedsUpdate:)
|
||||||
// name:NSViewGlobalFrameDidChangeNotification
|
name:NSViewGlobalFrameDidChangeNotification
|
||||||
// object:self];
|
object:self];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -336,10 +334,6 @@ static NSAutoreleasePool *pool;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long time = [event timestamp] * 1000000000;
|
long time = [event timestamp] * 1000000000;
|
||||||
//float dz = [event scrollingDeltaY]; // An OS X 10.7+ API
|
|
||||||
//if (![event hasPreciseScrollingDeltas]) { // Also an OS X 10.7 API
|
|
||||||
// dz *= 12; // or so
|
|
||||||
//}
|
|
||||||
jclass mouse_class = (*env)->GetObjectClass(env, _parent->jmouse);
|
jclass mouse_class = (*env)->GetObjectClass(env, _parent->jmouse);
|
||||||
jmethodID mousemove = (*env)->GetMethodID(env, mouse_class, "mouseMoved", "(FFFFFJ)V");
|
jmethodID mousemove = (*env)->GetMethodID(env, mouse_class, "mouseMoved", "(FFFFFJ)V");
|
||||||
NSPoint loc = [self convertPoint:[event locationInWindow] toView:self];
|
NSPoint loc = [self convertPoint:[event locationInWindow] toView:self];
|
||||||
|
@ -447,7 +441,6 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow(JNIE
|
||||||
NSRect view_rect = NSMakeRect(0.0, 0.0, width, height);
|
NSRect view_rect = NSMakeRect(0.0, 0.0, width, height);
|
||||||
window_info->view = [[MacOSXOpenGLView alloc] initWithFrame:view_rect pixelFormat:peer_info->pixel_format];
|
window_info->view = [[MacOSXOpenGLView alloc] initWithFrame:view_rect pixelFormat:peer_info->pixel_format];
|
||||||
if (window_info->context != nil) {
|
if (window_info->context != nil) {
|
||||||
printf("Setting context\n"); fflush(stdout);
|
|
||||||
[window_info->view setOpenGLContext:window_info->context];
|
[window_info->view setOpenGLContext:window_info->context];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,10 +477,6 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow(JNIE
|
||||||
// Inform the view of its parent window info; used to register for window-close callbacks
|
// Inform the view of its parent window info; used to register for window-close callbacks
|
||||||
[window_info->view setParent:window_info];
|
[window_info->view setParent:window_info];
|
||||||
|
|
||||||
//[window_info->window makeKeyAndOrderFront:[NSApplication sharedApplication]];
|
|
||||||
//[window_info->window makeFirstResponder:window_info->view];
|
|
||||||
//[window_info->window setReleasedWhenClosed:YES];
|
|
||||||
//[window_info->window setInitialFirstResponder:window_info->view];
|
|
||||||
[window_info->window performSelectorOnMainThread:@selector(makeFirstResponder:) withObject:window_info->view waitUntilDone:NO];
|
[window_info->window performSelectorOnMainThread:@selector(makeFirstResponder:) withObject:window_info->view waitUntilDone:NO];
|
||||||
[window_info->window performSelectorOnMainThread:@selector(setInitialFirstResponder:) withObject:window_info->view waitUntilDone:NO];
|
[window_info->window performSelectorOnMainThread:@selector(setInitialFirstResponder:) withObject:window_info->view waitUntilDone:NO];
|
||||||
[window_info->window performSelectorOnMainThread:@selector(makeKeyAndOrderFront:) withObject:[NSApplication sharedApplication] waitUntilDone:NO];
|
[window_info->window performSelectorOnMainThread:@selector(makeKeyAndOrderFront:) withObject:[NSApplication sharedApplication] waitUntilDone:NO];
|
||||||
|
@ -515,13 +504,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nDestroyWindow(JNIEnv
|
||||||
[window_info->window close];
|
[window_info->window close];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//window_info->window = nil;
|
|
||||||
|
|
||||||
//if (window_info->view != nil) {
|
|
||||||
// [window_info->view release];
|
|
||||||
// window_info->view = nil;
|
|
||||||
//}
|
|
||||||
//[window_info->window release];
|
|
||||||
|
|
||||||
//[pool drain];
|
//[pool drain];
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCre
|
||||||
MacOSXContext *context_info;
|
MacOSXContext *context_info;
|
||||||
NSOpenGLContext *context;
|
NSOpenGLContext *context;
|
||||||
NSOpenGLContext *shared_context = NULL;
|
NSOpenGLContext *shared_context = NULL;
|
||||||
printf("nCreate\n");
|
|
||||||
jobject context_handle = newJavaManagedByteBuffer(env, sizeof(MacOSXContext));
|
jobject context_handle = newJavaManagedByteBuffer(env, sizeof(MacOSXContext));
|
||||||
if (context_handle == NULL) {
|
if (context_handle == NULL) {
|
||||||
throwException(env, "Could not create handle buffer");
|
throwException(env, "Could not create handle buffer");
|
||||||
|
@ -118,7 +118,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_clearDr
|
||||||
(JNIEnv *env, jclass clazz, jobject context_handle) {
|
(JNIEnv *env, jclass clazz, jobject context_handle) {
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
MacOSXPeerInfo *peer_info = ((MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle))->peer_info;
|
MacOSXPeerInfo *peer_info = ((MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle))->peer_info;
|
||||||
printf("clearDrawable\n");
|
|
||||||
[[peer_info->window_info->view openGLContext] clearDrawable];
|
[[peer_info->window_info->view openGLContext] clearDrawable];
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
@ -126,8 +125,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_clearDr
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nReleaseCurrentContext
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nReleaseCurrentContext
|
||||||
(JNIEnv *env, jclass clazz) {
|
(JNIEnv *env, jclass clazz) {
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
printf("nReleaseCurrentContexta\n");
|
[NSOpenGLContext clearCurrentContext];
|
||||||
[NSOpenGLContext clearCurrentContext];
|
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +133,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_setView
|
||||||
(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
|
(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
|
MacOSXPeerInfo *peer_info = (MacOSXPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
|
||||||
printf("setView\n");
|
|
||||||
[[peer_info->window_info->view openGLContext] setView: peer_info->window_info->view];
|
[[peer_info->window_info->view openGLContext] setView: peer_info->window_info->view];
|
||||||
peer_info->canDrawGL = true;
|
peer_info->canDrawGL = true;
|
||||||
[pool release];
|
[pool release];
|
||||||
|
@ -145,8 +142,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nMakeCu
|
||||||
(JNIEnv *env, jclass clazz, jobject context_handle) {
|
(JNIEnv *env, jclass clazz, jobject context_handle) {
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
MacOSXPeerInfo *peer_info = ((MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle))->peer_info;
|
MacOSXPeerInfo *peer_info = ((MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle))->peer_info;
|
||||||
printf("nMakeCurrent\n");
|
[[peer_info->window_info->view openGLContext] makeCurrentContext];
|
||||||
[[peer_info->window_info->view openGLContext] makeCurrentContext];
|
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,8 +168,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nDestro
|
||||||
(JNIEnv *env, jclass clazz, jobject context_handle) {
|
(JNIEnv *env, jclass clazz, jobject context_handle) {
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
MacOSXPeerInfo *peer_info = ((MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle))->peer_info;
|
MacOSXPeerInfo *peer_info = ((MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle))->peer_info;
|
||||||
printf("nDestroy\n");
|
[[peer_info->window_info->view openGLContext] clearDrawable];
|
||||||
[[peer_info->window_info->view openGLContext] clearDrawable];
|
|
||||||
[[peer_info->window_info->view openGLContext] release];
|
[[peer_info->window_info->view openGLContext] release];
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue