<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>733</bug_id>
          
          <creation_ts>2013-05-11 18:19:42 +0200</creation_ts>
          <short_desc>GLWindow.warpPointer() causes slowdowns under Windows</short_desc>
          <delta_ts>2013-06-12 13:01:53 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>pc_all</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Julien Gouesse">gouessej</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>jogl 8ff185ef62c832408963f30a2b4875955d7ae650
jogl a446bfbb25397cf5876e766d0bb52cbaaa5f8e2f</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2582</commentid>
    <comment_count>0</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-05-11 18:19:42 +0200</bug_when>
    <thetext>When I call GLWindow.warpPointer() to reposition the mouse pointer in the center of the screen, the CPU time consumption of the NEWT thread noticeably increases and the frame rate decreases, it drives my game almost unplayable with a mouse or a touchpad. I have tried to reproduce this behaviour on a simple example:

https://github.com/gouessej/jogl/commit/ce0a9bfa52b20d79547e86a564cede89b90bb744

If you move the cursor during the test, you may notice this slowdown. I&apos;m going to improve it to exhibit the annoying behaviour more obviously.

I have reproduced this bug under Windows 7 64 bits, Java 1.7 update 21, with a Packard Bell Easynote MH 36. This problem doesn&apos;t go away when I use a mouse instead of the build-in touchpad even by increasing its sensitivity. However, this bug is not reproducible under Mageia Linux 2 on the same laptop. Performing the same moves with the keyboard doesn&apos;t cause such slowdowns.

Another way of reproducing this bug consists in running TUER:
http://tuer.sourceforge.net/very_experimental/tuer.jnlp
Go to &quot;Options&quot; -&gt; &quot;Controls&quot; and tick the checkbox &quot;Never hide the mouse pointer (for debug purpose only)&quot;. Go to &quot;Back&quot; -&gt; &quot;Back&quot; -&gt; &quot;Start&quot; -&gt; &quot;Story mode&quot; -&gt; &quot;Performance Test&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2586</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-05-12 20:38:29 +0200</bug_when>
    <thetext>The frame rate decreases a bit but the main problem comes from the responsiveness of the mouse. NEWT doesn&apos;t seem to be responsible for this bug as it works very well with Jake 2, I modified it and tested it with the very latest aggregated build. However, warpPointer() seems to have a different behavior under Windows and Linux.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2591</commentid>
    <comment_count>2</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-05-14 09:50:31 +0200</bug_when>
    <thetext>The generated events are not exactly the same under Linux and Windows when moving the mouse manually and with warpPointer(). I&apos;m not sure it was already the case with AWT. I&apos;m still investigating.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2644</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-06-09 09:11:41 +0200</bug_when>
    <thetext>You warp the pointer at every frame, this ofc may bring down rendering,
due to system/WM message overload etc ..

Have a look at the GearsES2 demo:
  &lt;http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java;hb=HEAD#l519&gt;

It only warps back to the middle when a mouse event actually has been received
and if that feature is enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2653</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-06-12 12:44:24 +0200</bug_when>
    <thetext>Refined your unit test, demonstrating warp-random at display 
and warp-center at mouseExit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2657</commentid>
    <comment_count>5</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-06-12 13:01:53 +0200</bug_when>
    <thetext>(In reply to comment #3)
&gt; You warp the pointer at every frame, this ofc may bring down rendering,
&gt; due to system/WM message overload etc ..
&gt; 
&gt; Have a look at the GearsES2 demo:
&gt;  
&gt; &lt;http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/
&gt; junit/jogl/demos/es2/GearsES2.java;hb=HEAD#l519&gt;
&gt; 
&gt; It only warps back to the middle when a mouse event actually has been
&gt; received
&gt; and if that feature is enabled.

Actually, warping the mouse pointer to the middle when a mouse event has been received is still slow on one of my laptops but the root cause has nothing to do with JOGL 2 and NEWT. When removing and reinstalling some Windows updates, some features become completely broken, it is no more possible to open the file explorer even though the environment variables are correctly set, there are spurious slowdowns in applications. I don&apos;t reproduce this bug on other machines under Windows.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>