org.lwjgl.input.Keyboard/org.lwjgl.input.Mouse

Started by technik3k, August 29, 2015, 19:33:22

Previous topic - Next topic

technik3k

Is there no more
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;

in lwjgl 3.

Kai

Someone should _finally_ opt in and do what would probably be most valuable thing anyone could do for LWJGL now:
writing a migration guide and making it very very very prominent on the lwjgl.org page, here on the forum, on the GitHub README.md and on the GitHub Wiki......
Almost half of the forum questions and almost every GitHub Issue is about what happened to all LWJGL2 APIs. :)

To answer your question (like onehundred alike questions before, no pun intended  ;) ):
No, these classes are gone in LWJGL3. You use GLFW in LWJGL3 now for creating windows and input handling.
See the Getting Started Guide on the lwjgl.org homepage.

You can also use the very nice adaptation layer https://github.com/kappaOne/lwjglx by kappa to keep on interfacing with the LWJGL2 API but use LWJGL3 under the hood.

quew8

Quote from: Kai on August 29, 2015, 19:43:46
Someone should _finally_ opt in and do what would probably be most valuable thing anyone could do for LWJGL now:
writing a migration guide and making it very very very prominent on the lwjgl.org page, here on the forum, on the GitHub README.md and on the GitHub Wiki......

Do you think this would actually be a helpful exercise? Because I'd be willing if there is a general consensus that it would be helpful. Covering the basics shouldn't take too long anyway.

Kai

Absolutely. I think so.
Considering that like 99.9% of people's games/engines and whatnot use LWJGL2 and since LWJGL3 is not yet officially out, it would right now be the perfect moment to prepare people for LWJGL3 by writing such a guide. Given, of course, that the API of LWJGL3 will not change significantly anymore.
I mean, what happens right now is that anyone coming to LWJGL3 is totally confused by the API change.
Then, they might either decide to ditch LWJGL3 and keep on using LWJGL2; or trying to fiddle around with the new API for themselves, which costs alot of time; or they ask questions on the forums or GitHub Issue, which they themselves might find bothering and that is really not necessary would there be such a guide.
But it should not be a tutorial only focusing on LWJGL3! Those are out there now. It should make a side-by-side comparison between LWJGL2 and LWJGL3.
I think such a migration guide is really missing now.

quew8

Fair enough.

I was thinking go through converting a simple LWJGL2 game to LWJGL3 in steps. Maybe that old space invaders that was hanging about the old wiki or maybe just write my own little pong or something. What do you think?

Kai

Yes, probably. I think the focus should also not be on a working "game" as that tends to focus more on the OpenGL part. I don't see any OpenGL mechanics in that guide, since the OpenGL functions are (apart from a few naming convention differences) the same.
Regarding OpenGL, the guide should just quickly point out the differences in the naming scheme of the OpenGL functions (i.e. added type suffixes in the method names).
The main focus should be on window and input handling with GLFW.
Not only the syntax/signature differences should be pointed out but also current limitations and bugs in GLFW or things fixed with GLFW but not in LWJGL2.
That would be very useful for people trying to migrate, for they would then know what to expect.
I see the guide currently as some small sections showing different aspects of input handling and window management with LWJGL2 and LWJGL3 code snippets. And then an explanatory paragraph, laying out the semantic differences and limitations.

quew8

I agree. I'll get on that then. My current project involves writing custom components in JavaFX which always gets on my nerves so this should make a welcome break. Hopefully that means it won't take too long.

spasi

Indeed, a migration guide that can be featured in the forum/site/github repo will be very helpful.