Fixed MouseTest

This commit is contained in:
Elias Naur 2008-04-07 16:20:35 +00:00
parent 97ebcea9c8
commit 40efb3e042
1 changed files with 7 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.glu.GLU;
import org.lwjgl.util.vector.Vector2f;
import org.lwjgl.util.vector.Vector3f;
@ -147,6 +148,12 @@ public class MouseTest {
*
*/
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);
}
@ -242,8 +249,6 @@ public class MouseTest {
if(Mouse.getEventButton() != -1 && Mouse.getEventButtonState()) {
lastButton = Mouse.getEventButton();
}
if (Mouse.getEventDX() != 0 || Mouse.getEventDY() != 0)
System.out.println("Mouse.getEventDX() = " + Mouse.getEventDX() + " | Mouse.getEventDY() = " + Mouse.getEventDY());
}
updateState();