LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Matzon on August 18, 2005, 12:47:12

Title: LWJGL 0.98 released
Post by: Matzon on August 18, 2005, 12:47:12
get it here:
https://sourceforge.net/project/showfiles.php?group_id=58488

Changes:
* Controller support, via JInput.
* Support for Window Icons
* Fast path to GLContext.getCapabilities() optimized for single threaded applications
* Mac OS X: Handle MouseEvent.NOBUTTON
* Added AccessController.doPrivileged where needed to make LWJGL installed as an extension work with sandboxed applications
* Miscellaneous fixes for OpenGL, Matrox Parhelia and Sis/Via  (the latter being a genuine lwjgl bug *gasp*)
Title: LWJGL 0.98 released
Post by: CaseyB on August 18, 2005, 13:26:32
WooHooo!  I can't wait to get home and play with the JInput stuff!!!  Is there a sample test file on Sourceforge?

LWJGL is awesome, you guys are doing a really great job!!
Title: LWJGL 0.98 released
Post by: Matzon on August 18, 2005, 13:28:09
*grumble*
jinput didn't make it into the release - I am repackeging... stay tuned
Title: LWJGL 0.98 released
Post by: Matzon on August 18, 2005, 14:08:55
fixed
jinput demo is available here: http://lwjgl.org/jnlp/lwjgl-demo.php/test.input.TestControllers
Title: LWJGL 0.98 released
Post by: CaseyB on August 18, 2005, 14:10:16
Awesome, Thank you!!

Also, I am pretty new to this stuff so can you explain what you mean by:
Quote* Added AccessController.doPrivileged where needed to make LWJGL installed as an extension work with sandboxed applications
How can it be installed as an extension?
Title: LWJGL 0.98 released
Post by: elias4444 on August 19, 2005, 16:57:27
Wonderful! Just one question: how do you do the window icon thing now?
Title: LWJGL 0.98 released
Post by: elias4444 on August 19, 2005, 17:29:03
Never mind... amazingly enough, I figured it out on my own. It helped that it was in the javadoc. :)
Title: Bug with Controllers
Post by: breath on August 20, 2005, 22:06:11
Hey there, I hate to break out the complaints already, but I'm having trouble with the Controllers breaking the Keyboard and I think it's a bug.  Basically, if I call Controllers.create(), I can't receive keyboard events.  Here's code that reproduces this problem:


import org.lwjgl.LWJGLException;
import org.lwjgl.input.Controller;
import org.lwjgl.input.Controllers;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

public class ControllerDemo implements Runnable {

public ControllerDemo() throws LWJGLException {
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].getWidth() == 320
&& modes[i].getHeight() == 240
&& modes[i].getBitsPerPixel() >= 16) {
Display.setDisplayMode(modes[i]);
break;
}
}
Display.create();


if (!Controllers.isCreated()) {
// if you comment this out, you start seeing keyboard events
Controllers.create();
}

if (!Keyboard.isCreated()) {
Keyboard.create();
}
}

public void run() {
while(true) {
Keyboard.poll();
Controllers.poll();
while (Keyboard.next()) {
boolean keyState = Keyboard.getEventKeyState();
int key = Keyboard.getEventKey();
System.out.println("Key: " + key + " " + keyState);
}
while (Controllers.next()) {
Controller c = Controllers.getEventSource();
for (int i=0;i<c.getButtonCount();i++) {
if(c.isButtonPressed(i)) {
System.out.println("Button: " + i);
}
}
}

try { Thread.sleep(10); } catch (Exception e) {};
}
}

public static void main(String[] args) {
try {
ControllerDemo demo = new ControllerDemo();
Thread t = new Thread(demo);
t.start();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}

}


When you run this code, and Controllers.create() is uncommented, you can press the buttons on your controller and see output, but hit some keys on your keyboard and it doesn't print anything.  If you comment out Controllers.create() you can hit keys and see events, but no controller events (obviously).
Title: LWJGL 0.98 released
Post by: Matzon on August 20, 2005, 22:23:23
confirming - jinput is probably getting exclusive access to the keyboard
Title: LWJGL 0.98 released
Post by: Matzon on August 20, 2005, 22:41:57
nope - DISCL_NONEXCLUSIVE | DISCL_BACKGROUND
probably because keyboard is running in dx3 mode and controller in dx8...
this one could get messy...
Title: LWJGL 0.98 released
Post by: breath on August 20, 2005, 23:41:46
Thanks for taking a look at it.  I wish I could help, but I don't know anything about DirectX.  Which is I guess why I'm an OpenGL Java programmer.  :-)