Fixed MouseTest
This commit is contained in:
parent
97ebcea9c8
commit
40efb3e042
|
@ -36,6 +36,7 @@ import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.Display;
|
import org.lwjgl.opengl.Display;
|
||||||
import org.lwjgl.opengl.DisplayMode;
|
import org.lwjgl.opengl.DisplayMode;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.glu.GLU;
|
||||||
import org.lwjgl.util.vector.Vector2f;
|
import org.lwjgl.util.vector.Vector2f;
|
||||||
import org.lwjgl.util.vector.Vector3f;
|
import org.lwjgl.util.vector.Vector3f;
|
||||||
|
|
||||||
|
@ -147,6 +148,12 @@ public class MouseTest {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private void initializeOpenGL() {
|
private void initializeOpenGL() {
|
||||||
|
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||||
|
GL11.glLoadIdentity();
|
||||||
|
GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
|
||||||
|
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||||
|
GL11.glLoadIdentity();
|
||||||
|
GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
|
||||||
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,8 +249,6 @@ public class MouseTest {
|
||||||
if(Mouse.getEventButton() != -1 && Mouse.getEventButtonState()) {
|
if(Mouse.getEventButton() != -1 && Mouse.getEventButtonState()) {
|
||||||
lastButton = Mouse.getEventButton();
|
lastButton = Mouse.getEventButton();
|
||||||
}
|
}
|
||||||
if (Mouse.getEventDX() != 0 || Mouse.getEventDY() != 0)
|
|
||||||
System.out.println("Mouse.getEventDX() = " + Mouse.getEventDX() + " | Mouse.getEventDY() = " + Mouse.getEventDY());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState();
|
updateState();
|
||||||
|
|
Loading…
Reference in New Issue