Slick Forums
http://slick.ninjacave.com/forum/

TWL and LWJGL 3
http://slick.ninjacave.com/forum/viewtopic.php?f=18&t=7090
Page 1 of 1

Author:  obidobi [ Mon Nov 24, 2014 5:02 am ]
Post subject:  TWL and LWJGL 3

Hi I'm wondering if someone has made any efforts getting TWL to work with LWJGL 3?

LWJGL 3 is using GLFW for display/input handling. When it comes to how TWL interfaces with LWJGL regarding Mouse/Keyboard/Display and Cursors there are some rewriting required.

Author:  dayrinni [ Tue Nov 25, 2014 1:54 pm ]
Post subject:  Re: TWL and LWJGL 3

obidobi wrote:
Hi I'm wondering if someone has made any efforts getting TWL to work with LWJGL 3?

LWJGL 3 is using GLFW for display/input handling. When it comes to how TWL interfaces with LWJGL regarding Mouse/Keyboard/Display and Cursors there are some rewriting required.


I have not upgraded to version 3 yet (I probably won't for some time) so I am not sure about this. Maybe MatthiasM can chime in.

Did you already do the rewrites, you sort of imply you may have done some :)

Author:  obidobi [ Sat Nov 29, 2014 8:15 am ]
Post subject:  Re: TWL and LWJGL 3

Well I took a look at it. I'm not just sure about the best way to go about it at this time.

The Mouse/Keyboard/Display and Cursor classes with static methods in LWJGL are gone since changing to glfw. Instead you register callback functions.
These callback functions receive a window pointer so you can control multiple windows. I guess one easy way to to get TWL to work with glfw would be to reimplement Mouse and Keyboard have them grab the callbacks and only support one window.

GLFW is certainly a big improvement over what was used in LWJGL 2. Nice API with enough documentation. Great support for multiple monitors and much more.
http://www.glfw.org/docs/latest/modules.html

Cursor handling is much better you can set a cursor to be in Normal, Hidden and Disabled mode. Disabled meaning it is hidden and locked and when you drag you get unlimited x and y coordinates, perfect for free look. Hidden moves the invisible cursor just giving coordinates within the limits of the window or screen resolution in case of fullscreen. I found the grabbed solution in lwjgl 2 always needing some hacky solution with Robot for free look.

One thing lacking LWJGL 3 is a usable GUI library. I like TWL since you can do pretty much anything with it :). With the theme editor as a nice reference implementation of a real application.

I'll let you know if I get somewhere with TWL and GLFW.

Author:  dayrinni [ Mon Dec 29, 2014 4:07 pm ]
Post subject:  Re: TWL and LWJGL 3

obidobi wrote:
Well I took a look at it. I'm not just sure about the best way to go about it at this time.

The Mouse/Keyboard/Display and Cursor classes with static methods in LWJGL are gone since changing to glfw. Instead you register callback functions.
These callback functions receive a window pointer so you can control multiple windows. I guess one easy way to to get TWL to work with glfw would be to reimplement Mouse and Keyboard have them grab the callbacks and only support one window.

GLFW is certainly a big improvement over what was used in LWJGL 2. Nice API with enough documentation. Great support for multiple monitors and much more.
http://www.glfw.org/docs/latest/modules.html

Cursor handling is much better you can set a cursor to be in Normal, Hidden and Disabled mode. Disabled meaning it is hidden and locked and when you drag you get unlimited x and y coordinates, perfect for free look. Hidden moves the invisible cursor just giving coordinates within the limits of the window or screen resolution in case of fullscreen. I found the grabbed solution in lwjgl 2 always needing some hacky solution with Robot for free look.

One thing lacking LWJGL 3 is a usable GUI library. I like TWL since you can do pretty much anything with it :). With the theme editor as a nice reference implementation of a real application.

I'll let you know if I get somewhere with TWL and GLFW.


Thanks a lot for the post! Were you able to make any more progress?

Did you have an existing game using LWJGL 2 or is this a new one you made? I'm pretty far along and won't be able to do an entire rewrite/start over so having some insight on your experiences would prove to be useful.

Plus, I don't think I ran into anything where I would need to upgrade I'm just making a simplish graphical game - mostly 2D Sprites.

Thanks!

Author:  ClickerMonkey [ Fri Sep 30, 2016 7:57 am ]
Post subject:  Re: TWL and LWJGL 3

I just implemented a port (https://github.com/ClickerMonkey/twl/tree/lwjgl3) - working on creating a separate project and build.

Author:  dayrinni [ Sat Oct 01, 2016 1:59 pm ]
Post subject:  Re: TWL and LWJGL 3

ClickerMonkey wrote:
I just implemented a port (https://github.com/ClickerMonkey/twl/tree/lwjgl3) - working on creating a separate project and build.


You're porting all of TWL to LWJGL 3?

Does this confirm that MatthiasM has officially ended his support for TWL?

I'm still using TWL and overall, I like it a lot so I was sad that it appeared to have ended support.

Author:  ClickerMonkey [ Sat Oct 01, 2016 8:17 pm ]
Post subject:  Re: TWL and LWJGL 3

All but the custom cursor code is "working" with TWL in my port (works in my games and tools).

I submitted an issue to the Git repo and he responded - he said ideally we would have a TWL-LWJGL2.jar and a TWL-LWJGL3.jar since the LWJGL version specific classes can easily be pulled out. I'm awaiting on him creating some repos so I can do the work. If he doesn't do it anytime soon, I'll probably just do it myself.

Author:  dayrinni [ Sun Oct 02, 2016 3:43 pm ]
Post subject:  Re: TWL and LWJGL 3

ClickerMonkey wrote:
All but the custom cursor code is "working" with TWL in my port (works in my games and tools).

I submitted an issue to the Git repo and he responded - he said ideally we would have a TWL-LWJGL2.jar and a TWL-LWJGL3.jar since the LWJGL version specific classes can easily be pulled out. I'm awaiting on him creating some repos so I can do the work. If he doesn't do it anytime soon, I'll probably just do it myself.


This is great news. Thanks a lot for doing this. I have wanted to stick with TWL long term and felt like that wasn't possible before and I would have to switch to the UI systems in LibGDX. It is also good Matthias responded.

Do you have any release binaries for your port yet? I may be willing to give them a try later this year.

Thanks!

Author:  ClickerMonkey [ Sun Oct 02, 2016 6:56 pm ]
Post subject:  Re: TWL and LWJGL 3

I'll work on putting it together later tonight.

Author:  ClickerMonkey [ Mon Oct 03, 2016 2:16 am ]
Post subject:  Re: TWL and LWJGL 3

Here are the projects created in the new organization:

https://github.com/ThemableWidgetLibrary/twl
https://github.com/ThemableWidgetLibrary/twl-lwjgl2
https://github.com/ThemableWidgetLibrary/twl-lwjgl3

You can see the README.md on those projects to a link to the built JARs.

Author:  dayrinni [ Thu Oct 06, 2016 1:28 pm ]
Post subject:  Re: TWL and LWJGL 3

ClickerMonkey wrote:
Here are the projects created in the new organization:

https://github.com/ThemableWidgetLibrary/twl
https://github.com/ThemableWidgetLibrary/twl-lwjgl2
https://github.com/ThemableWidgetLibrary/twl-lwjgl3

You can see the README.md on those projects to a link to the built JARs.


Great, thanks a lot. This will be really useful for me.

I just want to make sure I understand (since the repo links are different than what you originally posted), these are your repos and not Matthias, or are you two sort of sharing dev responsibilities now? I just want to make sure I know who and how to ask for help now for fixes/features :)

Thanks!

Author:  ClickerMonkey [ Thu Oct 06, 2016 5:10 pm ]
Post subject:  Re: TWL and LWJGL 3

I took the initiative and created the organization and repos. He seemed to be busy!

Author:  dayrinni [ Sat Nov 26, 2016 4:17 pm ]
Post subject:  Re: TWL and LWJGL 3

ClickerMonkey wrote:
I took the initiative and created the organization and repos. He seemed to be busy!


Cool - thanks. I have been busy and haven't been able to make the transition to LWJGL 3 just yet. I hope to do this in the nearish future, in December/January.

Thanks for keeping this alive. It seems LibGDX kinda pushed out all the other libraries/API. But I really like TWL and would like to keep using it.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/