Commit Graph

15 Commits

Author SHA1 Message Date
void bc37a79798 Mac OS X: fix custom mouse cursor image
According to
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/A
pplicationKit/Classes/nsbitmapimagerep_Class/Reference/Reference.html
the data referenced by the "planes" parameter will not be copied into
the NSBitmapImageRep class.

This means that when the referenced data changes (which is very likely
in our case since the data is retrieved from Java by
GetDirectBufferAddress()) we see exactly the effect described in the
LWJGL forum here: http://lwjgl.org/forum/index.php/topic,5007.0.html

The Apple class reference documentation linked above also describes
that when the "planes" parameter is NULL then the NSBitmapImageRep
class will allocate enough memory to store the image data and will
automatically free the allocated memory when the NSBitmapImageRep
instance is freed. In this case the data can be accessed with the
"bitmapData" method.

Which is exactly what we'll do now: pass NULL into the method to let it
allocate memory and then simply memcpy our image data into that area.

This seems to fix the mouse cursor image.
2013-05-25 17:56:05 +02:00
kappaOne 8deac76a5b Update author information 2013-04-21 15:37:02 +01:00
kappaOne d28381e1cd minor tweak to comments 2013-02-16 00:31:10 +00:00
kappaOne 1b48b704bc Move entire Display nCreate and nDestroy onto the Main Thread 0 2013-02-15 21:35:12 +00:00
kappaOne e15d172087 report Mouse.getX()/getY() values correctly on initial display creation. 2013-02-03 20:55:33 +00:00
kappaOne c328463776 Implement Cursor.destroy and release memory used by native cursors 2013-02-03 17:47:09 +00:00
kappaOne 4e023eec16 Implement animated cursor support on OS X 2013-01-29 22:59:40 +00:00
kappaOne 27cfdf646e Improve native cursor behaviour 2013-01-27 23:45:08 +00:00
kappaOne f0219aed1a Fix native cursor global handle passing 2013-01-26 22:47:36 +00:00
kappaOne fc2889cc27 Fix ARGB order on Native Cursors 2013-01-25 01:03:13 +00:00
kappaOne 486ff0edea Added initial work towards getting native cursors working, not
implemented yet
2013-01-25 00:28:26 +00:00
kappaOne a4c5be3781 fix OS X Mouse.setCursorPosition to use
CGDisplayMoveCursorToPoint instead of CGWarpMouseCursorPosition to allow
working on multiple monitor setups, also obtain correct window screen
instead of screen with keyboard focus
2012-12-25 14:00:09 +00:00
kappaOne 970fc2d7d9 Implement OS X Mouse.setCursorPosition() for windowed mode 2012-12-11 22:59:30 +00:00
kappaOne ccf738dfaf Implement OS X Mouse.setCursorPosition() when in fullscreen mode 2012-12-09 22:12:02 +00:00
Brian Matzon c09f5698b4 Comitting EmuMogs 28008537/src.zip drop to branch 2012-11-01 20:54:17 +00:00