Merge pull request #33 from void256/master

Mac OS X: fix custom mouse cursor image
This commit is contained in:
kappaOne 2013-05-25 09:05:52 -07:00
commit 83763eb873
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,7 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_MacOSXNativeMouse_nCreateCursor(JN
jlong *bytes = (jint *)(*env)->GetDirectBufferAddress(env, image_buffer) + images_offset;
NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:(jlong *)&bytes
initWithBitmapDataPlanes:NULL
pixelsWide:width pixelsHigh:height
bitsPerSample:8
samplesPerPixel:4
@ -137,6 +137,7 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_MacOSXNativeMouse_nCreateCursor(JN
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
bytesPerRow:width*4
bitsPerPixel:32] autorelease];
memcpy((void*)bitmap.bitmapData, (void*)bytes, width*height*4);
NSImage *image = [[[NSImage alloc] initWithSize:NSMakeSize(width, height)] autorelease];