LWJGL Forum

Programming => OpenGL => Topic started by: Mickelukas on May 25, 2009, 11:02:07

Title: [SOLVED] HW mouse cursor in applet doesn't release
Post by: Mickelukas on May 25, 2009, 11:02:07
Another issue with applets, I guess I'm one of the first that use it estensively under Windows ;)

After having updated the mouse cursor using Mouse.setNativeCursor() and then moving the mouse cursor outside the applet it keeps blinking between the actual cursor (set by the web browser) and the Native Cursor set by LWJGL.

I guess I could fix this by resetting the cursor when the mouse leaves the applet but then I need to know when the mouse leaves the applet in a reliable way.

If you want to test it go to:
http://dreamlandz.com (http://dreamlandz.com)

Fill in a random username and password under register and click Create.
Title: Re: HW mouse cursor in applet doesn't release
Post by: kappa on May 25, 2009, 11:14:18
hmm, i've used this on windows with applets before it should work, are you by any chance setting the native cursor every frame? or just once?
Title: Re: HW mouse cursor in applet doesn't release
Post by: Mickelukas on May 25, 2009, 11:22:20
Every frame, I guess I should only do it when something changes, which explains the blinking.

I'll change that and set the Subject to solved. Thanks!
Title: Re: [SOLVED] HW mouse cursor in applet doesn't release
Post by: Matzon on May 25, 2009, 11:28:18
I get the flickering - but not in the demo webstart: http://lwjgl.org/jnlp/lwjgl-demo.php/test.input.HWCursorTest

got these too:
Quotejava.lang.IllegalStateException: Function is not supported
   at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:64)
   at org.lwjgl.opengl.ARBBufferObject.glGenBuffersARB(ARBBufferObject.java:60)
   at dreamlandz.LandContainer.AddContainerToBuffer(LandContainer.java:293)
   at dreamlandz.LandContainer.AddContainerListToBuffer(LandContainer.java:67)
   at dreamlandz.OpenGL.loop(OpenGL.java:76)
   at dreamlandz.OpenGL.execute(OpenGL.java:797)
   at dreamlandz.Main$1.run(Main.java:163)
java.lang.IllegalStateException: Function is not supported
   at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:64)
   at org.lwjgl.opengl.ARBBufferObject.glGenBuffersARB(ARBBufferObject.java:60)
   at dreamlandz.LandContainer.AddContainerToBuffer(LandContainer.java:293)
   at dreamlandz.OpenGL.DrawSquares(OpenGL.java:609)
   at dreamlandz.OpenGL.loop(OpenGL.java:318)
   at dreamlandz.OpenGL.execute(OpenGL.java:797)
   at dreamlandz.Main$1.run(Main.java:163)
Exception in thread "Thread-17" org.lwjgl.opengl.OpenGLException: Invalid value (1281)
   at org.lwjgl.opengl.Util.checkGLError(Util.java:54)
   at org.lwjgl.opengl.Display.swapBuffers(Display.java:640)
   at org.lwjgl.opengl.Display.update(Display.java:660)
   at dreamlandz.OpenGL.loop(OpenGL.java:363)
   at dreamlandz.OpenGL.execute(OpenGL.java:797)
   at dreamlandz.Main$1.run(Main.java:163)

switched to another screen  (matrox suxor) and it worked (and got the flickering)
Title: Re: [SOLVED] HW mouse cursor in applet doesn't release
Post by: Mickelukas on May 25, 2009, 11:34:08
Quote from: Matzon on May 25, 2009, 11:28:18
I get the flickering - but not in the demo webstart: http://lwjgl.org/jnlp/lwjgl-demo.php/test.input.HWCursorTest

got these too:
Quotejava.lang.IllegalStateException: Function is not supported
   at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:64)
   at org.lwjgl.opengl.ARBBufferObject.glGenBuffersARB(ARBBufferObject.java:60)
   at dreamlandz.LandContainer.AddContainerToBuffer(LandContainer.java:293)
   at dreamlandz.LandContainer.AddContainerListToBuffer(LandContainer.java:67)
   at dreamlandz.OpenGL.loop(OpenGL.java:76)
   at dreamlandz.OpenGL.execute(OpenGL.java:797)
   at dreamlandz.Main$1.run(Main.java:163)
java.lang.IllegalStateException: Function is not supported
   at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:64)
   at org.lwjgl.opengl.ARBBufferObject.glGenBuffersARB(ARBBufferObject.java:60)
   at dreamlandz.LandContainer.AddContainerToBuffer(LandContainer.java:293)
   at dreamlandz.OpenGL.DrawSquares(OpenGL.java:609)
   at dreamlandz.OpenGL.loop(OpenGL.java:318)
   at dreamlandz.OpenGL.execute(OpenGL.java:797)
   at dreamlandz.Main$1.run(Main.java:163)
Exception in thread "Thread-17" org.lwjgl.opengl.OpenGLException: Invalid value (1281)
   at org.lwjgl.opengl.Util.checkGLError(Util.java:54)
   at org.lwjgl.opengl.Display.swapBuffers(Display.java:640)
   at org.lwjgl.opengl.Display.update(Display.java:660)
   at dreamlandz.OpenGL.loop(OpenGL.java:363)
   at dreamlandz.OpenGL.execute(OpenGL.java:797)
   at dreamlandz.Main$1.run(Main.java:163)

switched to another screen  (matrox suxor) and it worked (and got the flickering)

Flickering is gone now when I only update it when it needs to be updated.

If the ARBBufferObject function doesn't exist you'll get a line in the console saying "VBO extension:false". It should say something on the screen instead (for example, "Your current graphics card sucks so you can't play") but I'll add that later :)

When it worked, did you get a stable 60fps? (or whatever your vsync is)