From: <eli...@us...> - 2007-04-23 16:47:26
|
Revision: 2796 http://svn.sourceforge.net/java-game-lib/?rev=2796&view=rev Author: elias_naur Date: 2007-04-23 09:47:25 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Added support for non-direct buffers to Cursor Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java Modified: trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2007-04-22 21:29:28 UTC (rev 2795) +++ trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2007-04-23 16:47:25 UTC (rev 2796) @@ -35,6 +35,7 @@ import org.lwjgl.BufferChecks; import org.lwjgl.BufferUtils; +import org.lwjgl.NondirectBufferWrapper; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.Sys; @@ -86,13 +87,13 @@ synchronized (OpenGLPackageAccess.global_lock) { if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0) throw new LWJGLException("Native cursors not supported"); - BufferChecks.checkBuffer(images, width*height*numImages); + images = NondirectBufferWrapper.wrapBuffer(images, width*height*numImages); + if (delays != null) + delays = NondirectBufferWrapper.wrapBuffer(delays, numImages); if (!Mouse.isCreated()) throw new IllegalStateException("Mouse must be created before creating cursor objects"); if (width*height*numImages > images.remaining()) throw new IllegalArgumentException("width*height*numImages > images.remaining()"); - if (delays != null && numImages > delays.remaining()) - BufferChecks.checkBuffer(delays, numImages); if (xHotspot >= width || xHotspot < 0) throw new IllegalArgumentException("xHotspot > width || xHotspot < 0"); if (yHotspot >= height || yHotspot < 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |