LWJGL oddnesses (CVS version)

Started by UlfJack, March 29, 2004, 11:56:32

Previous topic - Next topic

UlfJack

So....

I just downloaded the newest lwjgl version from cvs and that renders my program unusable:

I was using lwjgl for rendering only (no input), but now the Keyboard and Mouse are automatically grabbed when the window is created - effectively, the mouse pointer vanishes and x-windows doesn't react to keyboard keys anymore (at all).

I understand that lwjgl is for game development (which is not what i am working at right now) and that it's supposed to be easy to use and that grabbing mouse and keyboard may make sense. However, there are several reasons why this is a bad idea (tm):

- grabbing mouse and keyboard exclusively is a bad idea, even for a game that's supposed to run fullscreen in the foreground - at least in x-windows the other windows become unaccessible and the program has to be killed in the text console (if it doesn't have a usable exit key or button)

- for programming/debugging sessions, it may be a good thing if one can choose not to acquire mouse and keyboard - like in the following scenario: i know that there is a bug in my game at a certain point, so i start the game such that it starts at the point where the bug is, i disable input and have a game window open while i am fixing the bug in the source - especially in linux this makes a lot of sense (ever worked with 4 desktops?)

- for a demo mode that doesn't need input, it makes sense to have the demo run in a window (i.e. not fullscreen) and use mouse and keyboard for other stuff

I hope that keyboard and mouse-grab will be made configurable, even if by some obscure command line option.

Cheers,

-- UlfJack

princec

I think the best workaround for this "unusual" use of the LWJGL is probably to put in a Java property that disables the default behaviour of creating the mouse when the window is created. (For 99% of other users it's what's wanted). As a quick workaround, just call Mouse.destroy() after the window is created.

Cas :)

UlfJack

That solves some of the problems, but not all. Not being able to get out of the window at all in linux is a serious problem. For example, you have a browser open with the walkthrough for that particular game. Even worse, some games don't allow you to save, so during the level you cannot get out of the f*cking window at all.

My fix was to hack the source and comment out your code.  :P

-- UlfJack