parent
245ef8ab03
commit
c3b04c1f20
|
@ -6,6 +6,7 @@ import java.nio.IntBuffer;
|
|||
import org.lwjgl.*;
|
||||
import org.lwjgl.openal.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.input.*;
|
||||
|
||||
/**
|
||||
|
@ -125,7 +126,7 @@ public class PositionTest extends BasicTest {
|
|||
GL11.glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GLU.gluPerspective(50.0, WINDOW_WIDTH / WINDOW_HEIGHT, 0.0, 50.0);
|
||||
GLU.gluPerspective(50.0f, (float) WINDOW_WIDTH / WINDOW_HEIGHT, 0.0f, 50.0f);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0f, 0.0f, -6.6f);
|
||||
|
@ -387,8 +388,8 @@ public class PositionTest extends BasicTest {
|
|||
|
||||
// Test for movement with Mouse
|
||||
// ============================================
|
||||
listenerPosition.put(0, listenerPosition.get(0) + (0.01f * Mouse.dx));
|
||||
listenerPosition.put(1, listenerPosition.get(1) + (0.01f * Mouse.dy));
|
||||
listenerPosition.put(0, listenerPosition.get(0) + (0.01f * Mouse.getDX()));
|
||||
listenerPosition.put(1, listenerPosition.get(1) + (0.01f * Mouse.getDY()));
|
||||
if (Mouse.isButtonDown(0)) {
|
||||
listenerPosition.put(2, listenerPosition.get(2) - 0.1f);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ package org.lwjgl.test.opengl;
|
|||
import org.lwjgl.*;
|
||||
import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.vector.Vector2f;
|
||||
|
||||
/**
|
||||
|
@ -49,9 +50,6 @@ public class FullScreenWindowedTest {
|
|||
/** Intended deiplay mode */
|
||||
private DisplayMode mode;
|
||||
|
||||
/** GLU instance */
|
||||
private GLU glu;
|
||||
|
||||
/** our quad moving around */
|
||||
private Vector2f quadPosition;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ package org.lwjgl.test.opengl;
|
|||
|
||||
import org.lwjgl.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.input.*;
|
||||
|
||||
import java.nio.*;
|
||||
|
@ -126,9 +127,9 @@ public final class Game {
|
|||
angle = 0.0f;
|
||||
|
||||
Mouse.poll();
|
||||
if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0)
|
||||
System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel);
|
||||
for (int i = 0; i < Mouse.buttonCount; i++)
|
||||
if (Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0)
|
||||
System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel());
|
||||
for (int i = 0; i < Mouse.getButtonCount(); i++)
|
||||
if (Mouse.isButtonDown(i))
|
||||
System.out.println("Button " + i + " down");
|
||||
/* Keyboard.poll();
|
||||
|
@ -137,9 +138,9 @@ public final class Game {
|
|||
Keyboard.read();
|
||||
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
|
||||
Keyboard.next();
|
||||
if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state)
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState())
|
||||
finished = true;
|
||||
if (Keyboard.key == Keyboard.KEY_T && Keyboard.state)
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState())
|
||||
System.out.println("Current time: " + Sys.getTime());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ package org.lwjgl.test.opengl;
|
|||
|
||||
import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.opengl.nv.*;
|
||||
import org.lwjgl.*;
|
||||
|
||||
|
@ -176,10 +177,10 @@ public class Grass {
|
|||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GLU.gluPerspective(40.0, 1.0, 1.0, 50.0);
|
||||
GLU.gluPerspective(40.0f, 1.0f, 1.0f, 50.0f);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
GLU.gluLookAt(14.0, 10.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
|
||||
GLU.gluLookAt(14.0f, 10.0f, -16.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
|
||||
|
||||
aslod.angle = 2.6179935f;
|
||||
aslod.value = 0.2f;
|
||||
|
@ -442,9 +443,9 @@ public class Grass {
|
|||
Keyboard.read();
|
||||
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
|
||||
Keyboard.next();
|
||||
if (!Keyboard.state)
|
||||
if (!Keyboard.getEventKeyState())
|
||||
continue;
|
||||
switch (Keyboard.key) {
|
||||
switch (Keyboard.getEventKey()) {
|
||||
case Keyboard.KEY_A :
|
||||
aslod.angle += 0.1;
|
||||
break;
|
||||
|
|
|
@ -34,6 +34,7 @@ package org.lwjgl.test.opengl;
|
|||
import org.lwjgl.*;
|
||||
import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.vector.Vector2f;
|
||||
|
||||
import java.nio.*;
|
||||
|
@ -51,9 +52,6 @@ public class PbufferTest {
|
|||
/** Intended deiplay mode */
|
||||
private DisplayMode mode;
|
||||
|
||||
/** GLU instance */
|
||||
private GLU glu;
|
||||
|
||||
/** our quad moving around */
|
||||
private Vector2f quadPosition;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ package org.lwjgl.test.opengl;
|
|||
|
||||
import org.lwjgl.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.opengl.arb.*;
|
||||
import org.lwjgl.input.*;
|
||||
|
||||
|
@ -129,9 +130,9 @@ public final class VBOIndexTest {
|
|||
angle = 0.0f;
|
||||
|
||||
Mouse.poll();
|
||||
if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0)
|
||||
System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel);
|
||||
for (int i = 0; i < Mouse.buttonCount; i++)
|
||||
if (Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0)
|
||||
System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel());
|
||||
for (int i = 0; i < Mouse.getButtonCount(); i++)
|
||||
if (Mouse.isButtonDown(i))
|
||||
System.out.println("Button " + i + " down");
|
||||
/* Keyboard.poll();
|
||||
|
@ -140,9 +141,9 @@ public final class VBOIndexTest {
|
|||
Keyboard.read();
|
||||
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
|
||||
Keyboard.next();
|
||||
if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state)
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState())
|
||||
finished = true;
|
||||
if (Keyboard.key == Keyboard.KEY_T && Keyboard.state)
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState())
|
||||
System.out.println("Current time: " + Sys.getTime());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ package org.lwjgl.test.opengl;
|
|||
|
||||
import org.lwjgl.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.lwjgl.opengl.glu.GLU;
|
||||
import org.lwjgl.opengl.arb.*;
|
||||
import org.lwjgl.input.*;
|
||||
|
||||
|
@ -125,9 +126,9 @@ public final class VBOTest {
|
|||
angle = 0.0f;
|
||||
|
||||
Mouse.poll();
|
||||
if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0)
|
||||
System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel);
|
||||
for (int i = 0; i < Mouse.buttonCount; i++)
|
||||
if (Mouse.getDX() != 0 || Mouse.getDY() != 0 || Mouse.getDWheel() != 0)
|
||||
System.out.println("Mouse moved " + Mouse.getDX() + " " + Mouse.getDY() + " " + Mouse.getDWheel());
|
||||
for (int i = 0; i < Mouse.getButtonCount(); i++)
|
||||
if (Mouse.isButtonDown(i))
|
||||
System.out.println("Button " + i + " down");
|
||||
/* Keyboard.poll();
|
||||
|
@ -136,9 +137,9 @@ public final class VBOTest {
|
|||
Keyboard.read();
|
||||
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
|
||||
Keyboard.next();
|
||||
if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state)
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState())
|
||||
finished = true;
|
||||
if (Keyboard.key == Keyboard.KEY_T && Keyboard.state)
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.getEventKeyState())
|
||||
System.out.println("Current time: " + Sys.getTime());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue