Hello Guest

[FIXED] Display.getX/getY report incorrect values (Windows)

  • 2 Replies
  • 4703 Views
*

Offline Elviz

  • *
  • 25
There seems to be a regression concerning the values returned by Display.getX/getY on Windows.

Test case (originally from this post):

Code: [Select]
import org.lwjgl.opengl.*;

public class WindowLocationTest {
  public static void main(String[] args) {
    try {
      Display.setDisplayMode(new DisplayMode(640, 480));
      Display.setLocation(0, 0);
      Display.create();
     
      for (int i = 0; i < 5; i++) {
        int x = Display.getX();
        int y = Display.getY();
       
        System.out.println("x=" + x + ", y=" + y);
       
        Display.setLocation(x, y);
      }
     
      Display.destroy();
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
}

Output using LWJGL 2.9.1 (correct):

Code: [Select]
x=0, y=0
x=0, y=0
x=0, y=0
x=0, y=0
x=0, y=0

Output using the latest LWJGL nightly build (2014-05-20):

Code: [Select]
x=0, y=505
x=505, y=1010
x=1010, y=1515
x=1515, y=2020
x=2020, y=2525

(Tested on a 64-bit Windows 7 system with a 32-bit JVM.)

*

Online spasi

  • *****
  • 2132
    • WebHotelier
Re: [BUG] Display.getX/getY report incorrect values (Windows)
« Reply #1 on: June 17, 2014, 18:07:08 »
Thanks, the bug should be fixed now. Please try the next nightly build.

*

Offline Elviz

  • *
  • 25
Re: [BUG] Display.getX/getY report incorrect values (Windows)
« Reply #2 on: July 04, 2014, 21:12:37 »
Working as expected in build #147. Thanks for fixing this.