LWJGL 0.98 released

Started by Matzon, August 18, 2005, 12:47:12

Previous topic - Next topic

Matzon

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*)

CaseyB

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!!

Matzon

*grumble*
jinput didn't make it into the release - I am repackeging... stay tuned

Matzon


CaseyB

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?

elias4444

Wonderful! Just one question: how do you do the window icon thing now?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias4444

Never mind... amazingly enough, I figured it out on my own. It helped that it was in the javadoc. :)
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

breath

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).

Matzon

confirming - jinput is probably getting exclusive access to the keyboard

Matzon

nope - DISCL_NONEXCLUSIVE | DISCL_BACKGROUND
probably because keyboard is running in dx3 mode and controller in dx8...
this one could get messy...

breath

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.  :-)