parent
924398d3c6
commit
b3e651c093
|
@ -37,7 +37,7 @@ import org.lwjgl.DisplayMode;
|
|||
import org.lwjgl.input.Controller;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.Window;
|
||||
import org.lwjgl.opengl.GLU;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.vector.Vector2f;
|
||||
|
||||
/**
|
||||
|
@ -89,7 +89,7 @@ public class ControllerCreationTest {
|
|||
|
||||
private void initializeOpenGL() {
|
||||
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
GLU.gluOrtho2D(0.0, 640, 0, 480);
|
||||
GLU.gluOrtho2D(0.0f, 640f, 0f, 480f);
|
||||
}
|
||||
|
||||
public void executeTest() {
|
||||
|
|
|
@ -34,6 +34,7 @@ package org.lwjgl.test.input;
|
|||
import org.lwjgl.*;
|
||||
import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
|
@ -50,9 +51,6 @@ public class HWCursorTest {
|
|||
/** Intended deiplay mode */
|
||||
private DisplayMode mode;
|
||||
|
||||
/** GLU instance */
|
||||
private GLU glu;
|
||||
|
||||
/** The native cursor */
|
||||
private static Cursor cursor = null;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.lwjgl.DisplayMode;
|
|||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.Window;
|
||||
import org.lwjgl.opengl.GLU;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.vector.Vector2f;
|
||||
|
||||
/**
|
||||
|
@ -48,9 +48,6 @@ import org.lwjgl.vector.Vector2f;
|
|||
*/
|
||||
public class KeyboardTest {
|
||||
|
||||
/** GLU instance */
|
||||
private GLU glu;
|
||||
|
||||
/** position of quad to draw */
|
||||
private Vector2f position = new Vector2f(320.0f, 240.0f);
|
||||
|
||||
|
@ -90,7 +87,7 @@ public class KeyboardTest {
|
|||
|
||||
private void initializeOpenGL() {
|
||||
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
GLU.gluOrtho2D(0.0, 640, 0, 480);
|
||||
GLU.gluOrtho2D(0.0f, 640f, 0f, 480f);
|
||||
}
|
||||
|
||||
public void executeTest() {
|
||||
|
@ -120,7 +117,7 @@ public class KeyboardTest {
|
|||
while (!Window.isCloseRequested()) {
|
||||
Window.update();
|
||||
|
||||
if(Window.isMinimized()) {
|
||||
if (Window.isMinimized()) {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException inte) {
|
||||
|
@ -134,10 +131,11 @@ public class KeyboardTest {
|
|||
Keyboard.read();
|
||||
|
||||
int count = Keyboard.getNumKeyboardEvents();
|
||||
while(Keyboard.next()) {
|
||||
while (Keyboard.next()) {
|
||||
System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.getEventKey()));
|
||||
System.out.println("Key character: " + Keyboard.getCharacter());
|
||||
if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
|
||||
System.out.println("Key character: " + Keyboard.getCharacter());
|
||||
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -157,15 +155,15 @@ public class KeyboardTest {
|
|||
position.y -= 1;
|
||||
}
|
||||
|
||||
if(Keyboard.isStateKeySet(Keyboard.KEY_SCROLL) == Keyboard.STATE_ON) {
|
||||
if (Keyboard.isStateKeySet(Keyboard.KEY_SCROLL) == Keyboard.STATE_ON) {
|
||||
System.out.println("SCROLL lock on");
|
||||
}
|
||||
|
||||
if(Keyboard.isStateKeySet(Keyboard.KEY_CAPITAL) == Keyboard.STATE_ON) {
|
||||
if (Keyboard.isStateKeySet(Keyboard.KEY_CAPITAL) == Keyboard.STATE_ON) {
|
||||
System.out.println("CAPS lock on");
|
||||
}
|
||||
|
||||
if(Keyboard.isStateKeySet(Keyboard.KEY_NUMLOCK) == Keyboard.STATE_ON) {
|
||||
if (Keyboard.isStateKeySet(Keyboard.KEY_NUMLOCK) == Keyboard.STATE_ON) {
|
||||
System.out.println("NUM lock on");
|
||||
}
|
||||
}
|
||||
|
@ -173,19 +171,18 @@ public class KeyboardTest {
|
|||
System.out.println();
|
||||
}
|
||||
|
||||
if(position.x<0) {
|
||||
if (position.x < 0) {
|
||||
position.x = 0;
|
||||
} else if (position.x>640-60) {
|
||||
position.x = 640-60;
|
||||
} else if (position.x > 640 - 60) {
|
||||
position.x = 640 - 60;
|
||||
}
|
||||
|
||||
if(position.y < 0) {
|
||||
if (position.y < 0) {
|
||||
position.y = 0;
|
||||
} else if (position.y>480-30) {
|
||||
position.y = 480-30;
|
||||
} else if (position.y > 480 - 30) {
|
||||
position.y = 480 - 30;
|
||||
}
|
||||
|
||||
|
||||
render();
|
||||
|
||||
Window.paint();
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.lwjgl.DisplayMode;
|
|||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.Window;
|
||||
import org.lwjgl.opengl.GLU;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.vector.Vector2f;
|
||||
|
||||
/**
|
||||
|
@ -49,10 +49,7 @@ import org.lwjgl.vector.Vector2f;
|
|||
* @version $Revision$
|
||||
*/
|
||||
public class MouseCreationTest {
|
||||
/** GLU instance */
|
||||
private GLU glu;
|
||||
|
||||
/** position of quad to draw */
|
||||
/** position of quad to draw */
|
||||
private Vector2f position = new Vector2f(320.0f, 240.0f);
|
||||
|
||||
/** Display mode selected */
|
||||
|
@ -92,7 +89,7 @@ public class MouseCreationTest {
|
|||
|
||||
private void initializeOpenGL() {
|
||||
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
GLU.gluOrtho2D(0.0, 640, 0, 480);
|
||||
GLU.gluOrtho2D(0.0f, 640f, 0f, 480f);
|
||||
}
|
||||
|
||||
public void executeTest() {
|
||||
|
|
Loading…
Reference in New Issue