Keyboard on Win2K?

Started by EgonOlsen, September 10, 2003, 23:56:55

Previous topic - Next topic

EgonOlsen

Hi,

i'm in the process of porting jPCT's OpenGL-renderer to LWJGL0.7. It works fine so far, but i've a problem with Keyboard.create().
On my two WinXP machines, the demo-app runs fine but on the Win2K one, i can't create a Keyboard. It's always telling me that the Keyboard could not be created and that there is "no window", which is obviously not true (http://www.jpct.net/pics/keyboarderror.jpg). This happens in fullscreen as well as in windowed mode and it worked fine using LWJGL0.6.
Maybe i'm doing something wrong?

Edit: That's on an Athlon XP 2200+ running Win2K Pro SP4 and a Geforce4Ti

elias

This is a very weird bug, because the hwnd is checked for NULL in Window.create. One clarifying question though: you are not by any chance doing the creation of LWJGL stuff from different threads, are you? If not, can you assemble a minimal application that exhibit the same behaviour?

EDIT: And what's the output from the debug build of LWJGL?

- elias

EgonOlsen

Quote from: "elias"This is a very weird bug, because the hwnd is checked for NULL in Window.create. One clarifying question though: you are not by any chance doing the creation of LWJGL stuff from different threads, are you? If not, can you assemble a minimal application that exhibit the same behaviour?

EDIT: And what's the output from the debug build of LWJGL?

- elias
Here it is: http://www.jpct.net/stuff/KeyboardTest.java

When run under WinXP, everything is fine but under Win2K, the Window is created and the Keyboard create() keeps telling me "No window" and i get the exception.

nala-naj

I dont have a win2k box to try this on, but you might want to add a this line after you create your keyboard...

Keyboard.enableBuffer();

elias

That won't work, because the bug occurs in the Keyboard creation. Now, before I try to stomp up a 2k, can any of you guys out there run the apparantly correct test?

- elias

nala-naj

Quote from: "elias"That won't work, because the bug occurs in the Keyboard creation. Now, before I try to stomp up a 2k, can any of you guys out there run the apparantly correct test?

- elias

i just tried it on a win2k box, but the graphics card is a piece of crap and doesnt support opengl (it is a 4mb card on the board)... after it pucked it did give me the No window message.

nala-naj

btw - i can try it on a good win2k box in about an hour when i go home for lunch... if you can wait that long.  how do i turn on debugging in lwjgl in case i need more info?

EgonOlsen

Here the output when using the debug-dll:

Window registered
Created window
Pixel format is 5
No window
java.lang.Exception: The keyboard could not be created.
        at org.lwjgl.input.Keyboard.create(Unknown Source)
        at KeyboardTest.doStuff(KeyboardTest.java:18)
        at KeyboardTest.<init>(KeyboardTest.java:10)
        at KeyboardTest.main(KeyboardTest.java:6)
Delete GL context
Destroying directinput
Releasing DC
Destroy window
Destroyed window

nala-naj

i just tried running your program at home on my win2k box and it ran great... sorry.

its a dell 1.5 ghz, 256mb ram, and a 32mb ati rage 128 ultra card
win2k professional that is... dont know if there is a home version for that or not.

EgonOlsen

Quote from: "nala-naj"i just tried running your program at home on my win2k box and it ran great... sorry.
No need to be sorry that it worked for you... :wink:  Anyway, i also tried it under Win98SE (same machine, dual boot) and it worked there too. But i don't think that something is fishy with my 2k (there is no "home" version of 2k btw. Professional is the smallest) because the Keyboard-stuff worked fine using LWJGL0.6...so something seems to have changed to the worse with 0.7.

elias

I'd still like to see the debug output from the debug LWJGL build. Can you supply us with that?

- elias

EgonOlsen

Quote from: "elias"I'd still like to see the debug output from the debug LWJGL build. Can you supply us with that?
I posted the output from the debug-dll some posts above. I that what you mean, or can i do something to get more detailed output?

elias

Sorry about that, I must have ovrelooked it.

- elias

elias

Yet another look at the code tells me that the only way the hwnd can be null after a succesful Window.create() is destroy() or a buffer overrun. Interestingly, Cas' fix for the matrox cards was in fact a buffer overrun fix(*), so your bug may already be fixed.

So Cas, can you upload a CVS build for Egon to test? As an added bonus,  he gets to test the NT4 fix at his workplace :-)

(*) Are you not feeling lucky to use java when issues like that arise? I certainly am.

- elias

princec